How to remove a value from a field via business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 09:28 AM
I have 3 values ina field which are being populated by Business rule. namely, A, B and c.
Now my requirement is based ona status i want to remove a value A from the field by keeping the values B and c.
Can anyone please help me on this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 09:35 AM
Hi
Create a UI policy giving the conditions for status and in script
Oncondition True():
g_form.setValue('var_A',''); like this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 09:40 AM
If the value is being set by a business rule then you need to add a check based on the state field which 2 options are valid and set the value accordingly if it matches either. if not then set to a default value.
example: status = Online can only have substatus = a/c.
in you if loop you will set value to what's coming from the source only if value matches a or c. if not(system is trying to set to b) then you need to identify a default for those records and set it to the default value(example a).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 10:10 AM
Hi Avneet,
i am trying the following code can you help me with it please.
var removeentry = new GlideRecord('server');
removeentry.addQuery('u_status',current.u_status);
removeentry.addQuery('u_hostname',current.hostname);
removeentry.addQuery('u_ip_address',current.ip_address);
removeentry.query();
if(removeentry.next()){
var ga = current.u_status;
if(ga = 'Retired'){
i was struck here and with the method i should use to remove the value from the fields Hostname and Ip address.
}
can yo help m eplease
thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2017 10:09 AM
Hi,
A Client script that works onChange of Status field would help & would be a better option as it would be reflected at same time (client side).