- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:11 AM
Hi guys
I have written one client script on onChange of Assignment group ,assigned_ to should be empty and state changes to new.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
g_form.setValue('assigned_to','');
//g_form.clearValue('assigned_to');
g_form.setValue('state', 1);
}
But it is not working I don't know why
Please help me with this
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:33 AM
Hi Monu gupta
try below code to clear the assigned_ to value i.e make it as empty.it should work, i have tried
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading)
return;
if (newValue != oldValue)
{
g_form.setValue('assigned_to','');
// g_form.clearValue('assigned_to');
g_form.setValue('state', 1);
}
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:27 AM
I tried with your trick also but not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:36 AM
What isn't working? Is it not blanking out the Assigned To field? Not updating to the appropriate state? Both?
Earlier in the thread you mention you want state to be New, but in the above code snippet you're setting it to 8 (shouldn't it be 1)?
If the script is doing nothing *at all*, try the following:
1) Verify that no other client scripts are touching assignment group / assigned to fields.
2) Verify that no UI policies are touching assignment group / assigned to fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:33 AM
Hi Monu gupta
try below code to clear the assigned_ to value i.e make it as empty.it should work, i have tried
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading)
return;
if (newValue != oldValue)
{
g_form.setValue('assigned_to','');
// g_form.clearValue('assigned_to');
g_form.setValue('state', 1);
}
PS: Hit like, Helpful or Correct depending on the impact of the response