To make variables mandatory when the 'closed complete' or 'closed incomplte' are clicked on a catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 04:30 AM
HI all,
I have a requirement where I have to make certain fields mandatory when clicked on closed complete or closed incomplete buttons on a catalog task.
I have written the following client script on the variable set:
Tyoe : onSubmit
function onSubmit() {
if(g_form.getValue('state') == '3')
{
g_form.setMandatory("variables.var1", true);
g_form.setMandatory("variables.var2", true);
}
}
But it is not working. please help.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 05:07 AM
Hi Roger,
Please try onChange client script or UI policy to achieve it .
Also please confirm, Is 'Closed complete' is a button(UI action)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 05:15 AM
The on Change script is also not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 05:11 AM
Hi Suseela,
Yes it is a UI action.
But these variables appear only on selected tasks,
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 05:23 AM
Hi Roger,
If it is an UI action, please follow the steps mentioned by Shloke.
Change the UI action script to make mandatory fields .
Hope this might be helpful.
If the reply was informational, please like, mark as helpful or mark as correct!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 05:29 AM
My Bad. Didn't notice you want to make variables mandatory on click of UI Action. The script which I provided above will work for Normal fields. In order to achive your requirement please follow the below steps:
Update your Script as below:
On Line Number 3 Replace g_form.setMandatory('description',true) with the code as mentioned below:
g_form.setMandatory('variables.variable_name', true);
Please find the Updated Script screen shot as below:
In the above screen shot Replace "requestor_email" in line Number 3 with your Variable name and this will solve your issue.
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke