Script in data policy

suryan
Kilo Expert

Below is the script written in UI policy to make fields as mandatory based on condition, how to write this in data policy, since it cannot be

converted since UI script is running a script.

UI policy code:

var fields = g_form.getEditableFields();

for (var x=0; x < fields.length; x++){  

  if (fields[x] != 'sys_created_on' && fields[x] != 'sys_created_by' && fields[x] != 'sys_updated_on' && fields[x] != 'sys_updated_by')  

      g_form.setReadOnly(fields[x],true);  

}

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

This is not possible as far as I understand on Data policy


But you can try to do the same via a business rule on the table.


View solution in original post

8 REPLIES 8

Kalaiarasan Pus
Giga Sage

This is not possible as far as I understand on Data policy


But you can try to do the same via a business rule on the table.


Hi Kalai,


How to write below code in business rule.



I know u cant use g_form   in business rule



g_form.setReadOnly(fields[x],true);



is this can be write as current.setReadonly()?


Are you trying to make readonly or fields as mandatory? If readonly - Refer the comments by Gaurav.


ACLs? how about if there is more than 70 fields to make fields as read only. Need to add 70 fields as read only in acls