UI Policy best method to update existing UI Policy to apply to new records & not existing records

Winnie P
Mega Sage

Hello there, I have a simple request to update an existing UI Policy with new conditions. When updating the UI Policy – this works for new records, good, but it affects existing records, where now the variable shows in existing records, when it should not. I have seen many posts with different resolutions so am curious to find out what is the best method to make this change, nowadays?  

New conditions hi-lighted in yellow:

WinnieP_0-1702195002328.png

 

UI Action:

WinnieP_1-1702195018041.png

 

Also has existing Run script;

 

WinnieP_2-1702195033827.png

 

Thanks.

2 REPLIES 2

Pavankumar_1
Mega Patron

Hi @Winnie P ,

Generally UI  Policy will works for both On change and Onload. If you need to work UI Policy only for new records then you have to give condition using created date field or use g_form.isNewRecord() on script then execute your ui policy actions.

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

AshishKM
Kilo Patron
Kilo Patron

Hi @Winnie P , 

As you updated the UI policy means some thing change on form side, there may be new fields added on form but old record doesn't have those new field and UI policy's OR condition not executing the OR condition for new fields on old records.

 

-Thanks,

AshishKMishra


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution