Unable to hide currency field

shaik23
Tera Expert

Hi,

i have a requirement, i want to hide currency field based on request type. When request type is Disposal or Mass disposal then the currency type should visible.

i have tried with UI policies' but didn't work then, i wrote Onchange client script still it showing the field when the request type is none, when the page loads if i select disposal or mass disposal the field is  visible but when i change the request type again to none the currency field remains visible.

 

This is the script i written please suggest if anything wrong.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
   var requestType = g_form.getValue('u_request_type');
    var bookValueField = g_form.getControl('u_book_value');

    if (requestType === 'Disposal' || requestType === 'Mass Disposal') {
       
        g_form.setVisible('u_book_value', true);
    } else {
        g_form.setVisible('u_book_value', false);      
    }
}
 if (g_form.isNewRecord()) {
    g_form.setVisible('u_book_value', false);
 }
   
7 REPLIES 7

Danish Bhairag2
Tera Sage
Tera Sage

Hi @shaik23 ,

 

U can create 1 onLoad UI policy where create one UI policy action with Book Value as Visible 'False'.

 

Then create one more UI policy but this time keep condition in it with Request Type is Disposal or Request type is Mass Disposal & add a UI policy action as Book value visible True. keep the order maybe 150 or 200 of that UI policy.

 

Thanks,

Danish

 

@shaik23 

 

if u want to stick with above client script then just create one onLoad UI policy with no condition n UI policy action as Book Value Visible False.

 

Thanks,

Danish

 

Hi @Danish Bhairag2  ok let me try

Hi @Danish Bhairag2  Tried the method which you suggested the field is hidden but not visible as per condition