Hide Choices in Approval table state

armanoj
Mega Sage

Hi ,

 

I'm trying to hide the choice value in state field in the approval tabe base on the source table. I used onload client scrit to hide the option but working .

1 ACCEPTED SOLUTION

@armanoj 

Another approach is to use a Display Business Rule to pass the source table value to the client using g_scratchpad, and then reference that value in your Client Script.

(function executeRule(current, previous) {
g_scratchpad.sourceTable = current.getValue('source_table');
})(current, previous);

Client Scripit

var sourceTable = g_scratchpad.sourceTable;

View solution in original post

5 REPLIES 5

RajveerSingh
Tera Expert

Hello @armanoj 

Follow it

function onLoad() {

var sourceTable = g_form.getValue('source_table');

if (sourceTable == 'sc_req_item') {
g_form.removeOption('state', 'approved');
// g_form.removeOption('state', 'rejected');
}
}