How do i call an onSubmit client script on a catalog task for only certain variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 11:02 AM
I have a catalog item where i am creating 2 catalog tasks in the workflow.
When i close the first catalog task in the workflow, it opens another catalog task.
There are about 6 or 7 check box variables that are only visible on the the first catalog task and these are mandatory. The mandatory check for the checkbox variables
is being called on the OnSubmit event. IT works great on the first task.
However these checkbox variables are not available on the 2nd task and don't need to be checked for mandatory. But since my script runs on the OnSubmit it is triggered
for all the catalog tasks.
How do i make this script run only on the first task. Is there a way to check if the check box variables exist on a task before calling the OnSubmit?
Any input is appreciated.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 03:51 PM
This worked perfectly. Exactly what i was looking for. Thank you so much for your input. appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 11:42 AM
In similar situation, I've done g_form.getValue('short_description'). Then, based on the name of the short description, determine which fields to set as mandatory and what is not. Though, I do not recommend using mandatory for checkboxes (since what you really mean is to make that checkbox always checked). Instead, set default value as true, then set read-only is true on an onLoad script instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 12:25 PM
So , where do i check for the task short description ? In the catalog client script that only applies to the task?