Remove option for related list form

sruthig
Tera Expert

Hi Team,

I have working on Custom application

We have 5 Account type and Request Type is  added to all account type.

Request Type field created on master table - ( We have 5 request type)

Related List - Account 

We have 'Account Name' field in the related list(Account). 'Account Name' contains 5 choices. If Request type is 'A' or 'B' Then I need to hide Account1 choice from 'Account Name field of the related list.

How can I achieve this using UI Policy Script. UI Policy created on 'Account' related list Table. I have to remove other choices from Account Name for different request type. So that I am using UI Policy script instead of adding the UI Policy condition.

Please help me to correct the below code.

 

Var req = new GlideRecord('Master table');

req.addQuery('u_req_type', reqtype);

req.query();

If(req.next()) {

}

if(reqtype=='A' || reqtype=='B'){

g_form.removeOption('u_account_name', 'Account1');

}

 

0 REPLIES 0