Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Version: Windchill 13.0
Use Case: I have managed to ensure that users have to provide text in the "Comments" field for all workflow tasks in Windchill. I achieved this using the method detailed under the "Instructions for Windchill PDMLink 10.0 - 12.1" at https://www.ptc.com/en/support/article/CS35488?source=search.
Description:
The issue with this solution is that the solution applied to all workflow tasks. I would like to be able to only apply this solution to workflow tasks that are generated as a result of them being produced from a certain workflow. The article found at https://www.ptc.com/en/support/article/CS35488?source=search includes a function that is added into the custom.jsfrag file. I was wondering if it would be possible to include text in this function that will result in the result I am looking for. For example, some sort of "If" condition that checks the "Process" attribute value of the workflow task to see if it matches a certain value before applying the functionality. Can anybody help?
Solved! Go to Solution.
If you want to target specific tasks to make comments required, you can use the method described here: https://community.ptc.com/t5/Windchill/Requiring-comments-to-be-entered-in-a-task-before-allowing/m-p/424683#M50030%3Fsource=search
On the task completion transition, this does a check and will throw an error to the user, preventing the completion of the task. You can set the error message, and control how many characters are entered. In the example code, he's requiring 10 characters.
The trick you need to solve is that the js validate function is operating in the browser, has no direct access to the process or task attributes to allow you that on/off switch you are looking for. What you need is a way for the resulting task page to have that attribute redered, either visable to the user or hidden, and your JS function is able to detect it. Have you tried adding a boolean flag as a process or task variable and see if it appears in the resulting HTML page? If so and if its consistent, your JS function just needs to look for it and read its value.
Well the workflow task does have an attribute called "Process" which details the workflow that produced the task. I was hoping that attribute could be used to do the trick.
If you want to target specific tasks to make comments required, you can use the method described here: https://community.ptc.com/t5/Windchill/Requiring-comments-to-be-entered-in-a-task-before-allowing/m-p/424683#M50030%3Fsource=search
On the task completion transition, this does a check and will throw an error to the user, preventing the completion of the task. You can set the error message, and control how many characters are entered. In the example code, he's requiring 10 characters.
Thanks very much Joe.
