- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 10:57 PM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 11:04 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 12:07 AM
Hi Shaik,
You can use g_form.clearValue('fieldname');
this will clear the value of the specified field.
Thanks,
Swati
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 02:41 AM
Thanks Swati. I got it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 12:26 AM
Hello Irfan,
Greetings for the day !
You can use UI Policy with script.
With true condition you can clear field using code as g_form.clearValue('fieldname');
This will clear value of the specified field.
Best regards,
Vaijanath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2017 02:41 AM
Thanks Vijay. I got it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2019 08:55 PM
I have two fields on the form that I need to clear. What is the script for this please? I have a catalog client script and I have the g_form.clearOptions for the first field but if I use it also for my second field when I select it as a drop-down I receive an error on the form and I cannot see the list.