Do 'g_form' work on UI Policy script?

Anish Reghu
Kilo Sage
Kilo Sage

Can I use the g_form methods in the UI Policy scripts?

 

function onCondition()
{
var fields = g_form.getEditableFields();

for(var x = 0; x < fields.length; x++)
{
g_form.setReadOnly(fields[x],true);
}

}

 

If yes, will this code get executed in the UI Policy?

1 ACCEPTED SOLUTION

User166992
Tera Guru

Hello,

Yes, g_form works well in UI Policy. If you try above code, the form should be readonly atleast in Application View.

 

Best Regards,

Jai

View solution in original post

3 REPLIES 3

User166992
Tera Guru

Hello,

Yes, g_form works well in UI Policy. If you try above code, the form should be readonly atleast in Application View.

 

Best Regards,

Jai

Hello,

 

To add to my comment, above-mentioned function getEditableFields is not supported in Service Portal.

 

Best Regards,

Jaikumar

manukundur
Giga Contributor

Hi Anish,

 

yes we can use this script in UI policy. I tried this on incident form and it works.