Trigger UI Policy for existing record and not new record

Nisar2
Mega Guru

Hi,

This may already have been answered but perhaps my search keywords are wrong as all my searches have come up as unhelpful.

However, I was wondering if there was a way to "trigger" a UI Policy only when the form is not a new record rather it's an existing record whose details we are viewing.

Use case scenario:

Currently, I have a requirement to make the "From" and "To" fields as readonly (so as the prevent the user from changing the pre-populated values) when the form loads. The problem here is that using the "onload" event in the "When to run" tab also executes the policy when the form is blank and ready to be created a new record.

I would rather not run the policy when it's a new record. Is this possible? Hope my wording was sufficient enough to be understandable.

Thanks,

Nisar

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

in the ui policy script part you can use the function g_form.isNewRecord() as condition and set the action using script in ui policy 

View solution in original post

5 REPLIES 5

Harsh Vardhan
Giga Patron

in the ui policy script part you can use the function g_form.isNewRecord() as condition and set the action using script in ui policy 

So does that mean this needs to go in "Execute if true" section? Also, I'm guessing this is the only way/work around? I was hoping to not use even a single line of script/code.

So does that mean this needs to go in "Execute if true" section? "If you are using script part in ui policy then you can unchecked the "Reverse if false" check box "

 

 

I'm guessing this is the only way/work around? "YES that's the only way you can do that 

Well, thanks for the solution. I'll take it.