Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Do 'g_form' work on UI Policy script?

Anish Reghu
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.