- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2024 02:04 AM
Requirement : When CI is choosen, associated location has to update in location field in Incident form.
My solution : Onchange Client Script as follows:
var prevLocation = g_form.getValue('location');
if (!newValue) {
g_form.clearValue('location', '');
g_form.setValue('location', prevLocation);
} else {
var loc1 = g_form.getReference('cmdb_ci', setLocation);
function setLocation(loc1) {
g_form.setValue('location', loc1.location);
}
}
Issue: when ci value is choosen, location field is autopopulating. As CI is not a mandatory field, when ci removed - location field is new set value. But requirement is when we clear CI field , location should be as previous Value.
Please suggest.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2024 04:14 AM
Tried with separate ui policy when ci is empty
and to set value written a client script.
Thanks vamshi krishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2024 02:13 AM
Also Tried
g_form.clearValue('location');
But it hasnt worked. May be location is also a refeence field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2024 02:49 AM
So correct my understanding
when ci value is chosen, location field is auto populating.
As CI is not a mandatory field, when ci value is removed - location field is set to new value.
Your requirement is when we clear CI field & not not chosen new ci value, location should not be new value& should be same as previous Value which was there before clearing CI value , correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2024 04:14 AM
Tried with separate ui policy when ci is empty
and to set value written a client script.
Thanks vamshi krishna