How to clear field value using UI Policy

shaik_irfan
Tera Guru

Hello Everyone,

I have a requirement where i need to clear field value using UI Policy.

Actual scenario is i created a variable set for Requested for & Request By where Request By auto populates current user name by default where i written javascript:gs.getUserID(); in default value. By referring Request By Requested for autopopulates the same name now my query is to clear Request for field only for 1 Item.

Please let me know how to clear field value for specific item.

Thanks in advance.

alikuttyka

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

If the UI policy is specific to your catalog item then you need to create UI policy inside it and not on the variable set.



Use the run scripts option on UI policy based on your condition and add this line to reset the required field



g_form.setValue('variable_name', '');



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


View solution in original post

9 REPLIES 9

Alikutty A
Tera Sage

If the UI policy is specific to your catalog item then you need to create UI policy inside it and not on the variable set.



Use the run scripts option on UI policy based on your condition and add this line to reset the required field



g_form.setValue('variable_name', '');



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


Thanks Gem


anjalichoudhary
Kilo Guru

Hi Shaik,



You write a script in UI policy. Here is the snapshot of how your script will look. Just replace description with your variable name.



find_real_file.png



Thanks,


Anjali


Thanks Anajali. I got it.