- 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:49 AM
I tested the following and its working for both of your cases mentioned:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if (newValue || newValue=='')
{
g_form.setValue('assigned_to','');
//g_form.clearValue('assigned_to');
g_form.setValue('state', 1);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:16 AM
Hi,
Modify your Script as below:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(newValue!=oldValue)
{
g_form.setValue('assigned_to','');
//g_form.clearValue('assigned_to');
g_form.setValue('state', 1);
}
}
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:19 AM
not working I already tried
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:22 AM
Can you Post a Screenshot of your Script Form? And would also like to cross check if you have written this On Change Client Script on Assignment Group Field ?
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 05:25 AM