Proper syntax for scripting a Catalog UI Policy against a Record Producer

scottatah
Giga Expert

Hi Everyone,

I'm putting together a Record Producer that will ultimately feed into the Call table.   I've got a need to show and hide fields, but am struggling to handle them through basic UI Policies, so I'd like to use the true/false scripts, but I'm struggling with the proper syntax.   I've tried a few different options to no avail.

function onCondition() {

  if(current.variables.authorization != 'Yes'){

  alert("Syntax Correct");

  //g_form.setDisplay('producer.instructions', true);

  }

  }

Thanks,

Scott

1 ACCEPTED SOLUTION

scottatah
Giga Expert

Thanks folks, after going in a few circles, I finally just wrote it as a client script.   The suggestions you guys gave got me started down that road.   Below is the syntax for a simple client script against a record producer.



if(g_form.getValue('authorization') == 'Yes'){


  //alert("Auth: Yes");


  g_form.setMandatory('cif', false);


  g_form.setValue('cif', '');


View solution in original post

3 REPLIES 3

Kalaiarasan Pus
Giga Sage
  1. if(g_form.getValue('variables.authorization') != 'Yes'){  
  2.   alert("Syntax Correct");
  3. }

Abhinay Erra
Giga Sage

current object is only availabel on server side. Use this



function onCondition() {  


 


  if(g_form.getValue('authorization') != 'Yes'){  


  alert("Syntax Correct");  


  g_form.setDisplay('instructions', true);  


 


  }  


  }  


scottatah
Giga Expert

Thanks folks, after going in a few circles, I finally just wrote it as a client script.   The suggestions you guys gave got me started down that road.   Below is the syntax for a simple client script against a record producer.



if(g_form.getValue('authorization') == 'Yes'){


  //alert("Auth: Yes");


  g_form.setMandatory('cif', false);


  g_form.setValue('cif', '');