Need to clear assigned to when assignment group is changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 12:30 AM
Hi,
I need to remove 'closed cancel', 'closed completed' states when state is open, only when state is 'work inprogress' those two fields should be visible.
And assigned to should be mandatory in 'open' state, when assignement group is changed , assigned to should be empty.
Can this be achieved in one onchange cleint script?
if not how do I write script for this?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 12:34 AM
Hi
What do you mean? Do you want to remove "closed cancel" and "closed complete" from the List of values in the State field?
Or are there fields on the screen, you want to hide?
Can you send a screenshot, showing what you want to achieve?
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 12:37 AM
need to hide on form , I used g_form.removeoption and it is working, i want assigned to b empty whn group changes

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 02:03 AM
HI
OK, Thank you. You can do so with a business rule, that fires as soon as the "Group" field CHANGES.
Then in the BR, you can clear out the value in the "Assigned to" field.
Depending on your table - in my example I just took the "task" table. See the business rule below:
Let me know, if that answered your question, and mark my answer as correct or helpful.
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 01:07 AM
Hi rambo,
1) need to remove 'closed cancel', 'closed completed' states when state is open, only when state is 'work in progress' those two fields should be visible.
Answer- you can create onchange client script- use addoption() and removeoption()
2) assigned to should be mandatory in 'open' state, when assignment group is changed , assigned to should be empty.
Answer-
you can create onchange client script on assignment group-
ex-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(g_form.getValue('assignment_group' == '') || (newValue !=oldValue) )
{
//g_form.clearValue('assigned_to');
g_form.setValue('assigned_to','');
}
OR you can create UI policy with condition when assignment group change
UI policy action will clear the value of assigned to filed
Thanks,
Vishal