- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 08:09 AM
Hi Everyone,
I am trying to modify the value of Pending Reason field (u_pending_reason) in a task in an OnChange Client Script.
I use below code:
g_form.setValue('state', '-5'); // set "state" field to "Pending"
g_form.setValue('u_pending_reason', 'Waiting user information');
'Waiting User information' is the fist choice of standards value of this field.
However, after applying the script, the field is updated with a new value 'Waiting user information' instead of the standard one:
I also tried using numbers to change the value (like for the 'state' field), but it does not work:
Does someone knows how to update this field with a standard value ?
Thank you very much in advance for your support !
Sylvain
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 08:30 AM - edited ‎10-18-2023 08:32 AM
This would depend on how you have the custom variable "u_pending_reason" configured...if you have a label and value mismatch (like the state field), you'll want to set the value without quotes.
You can also try an intermediate variable:
var reason = 'Waiting user information';
g_form.setValue('state', '-5'); // set "state" field to "Pending"
g_form.setValue('u_pending_reason', reason); <--notice, no quotes on "reason"...
...if this doesn't help, please post a screenshot of your choice list on the custom variable with value and label.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 08:30 AM - edited ‎10-18-2023 08:32 AM
This would depend on how you have the custom variable "u_pending_reason" configured...if you have a label and value mismatch (like the state field), you'll want to set the value without quotes.
You can also try an intermediate variable:
var reason = 'Waiting user information';
g_form.setValue('state', '-5'); // set "state" field to "Pending"
g_form.setValue('u_pending_reason', reason); <--notice, no quotes on "reason"...
...if this doesn't help, please post a screenshot of your choice list on the custom variable with value and label.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 09:02 AM
Thank you for your prompt reply !
I checked in variable configuration and indeed the value is "waiting_user_information"...
Thank you very much for your support!
Kr,