Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to remove a value from a field via business rule

ursnani
Giga Guru

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

9 REPLIES 9

harshinielath
Tera Expert

Hi


Create a UI policy giving the conditions for status and in script


Oncondition True():


g_form.setValue('var_A',''); like this


akt_snow
Giga Expert

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).


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.


Jaspal Singh
Mega Patron

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).