- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 01:53 AM - edited 08-28-2024 01:55 AM
Hello All,
I have one field named "Requested for" and that field type is requested for only and this field type behaviour is it will autopopulate logged in user name over this field as default value.
To remove default value from this field I have added "javascript: clearValue()".
But due to this everything is working fine in portal side but in backend when we try to create request from catalog item all the fields which are after this field are not visible and request button is also not visible.
Can anyone have any idea on this issue?
Is there any other way to clear default value of "requested for" field type?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 02:56 AM
Hi @priyanka1028,
Use the following syntax in the 'Default Value' of the 'Requested For' variable as shown below:
javascript:gs.getUserID = '';
Please note, there is no easy way (or something that is ideal from a performance perspective) where you can set this across all Items. Unfortunately, a Global UI Script would run on every form (not just catalog items), so it would be better to implement across each item.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 03:10 AM
Hello @priyanka1028 ,
If no default value has to be populated, better to keep 'Default value' empty/null/do not put anything in default value field. It will not auto-populate the logged in user name. Hope it helps.
If my response helps you in any way, kindly mark this as Accepted Solution/Helpful and help in closing this thread.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 03:35 AM
Hi @priyanka1028,
Interesting question as the whole point and functionality of the 'Requested For' type field is the auto population of the currently logged in user.
Quickly testing with both an onLoad Client Script and Best Practice UI Policy (which is last to execute when a page loads), I am still unable to clear the value using the tried and tested g_form.clearValue('requested_for') syntax.
Question: Is this for a specific Catalog Item or all of the Items?
If it's for a specific Item, you could actually remove this variable from the item and create a new variable (again called 'requested_for') and make it of type Reference (pointing at the sys_user table) and by default is will be emptry.
(Obviously apply any reference qualifiers etc to limit selection as required)
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 10:09 AM
Hi @Robbie ,
Answering to your question it is for all the items, In every item we have "Requested for" field type.
Is there any other way to clear field default value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 02:56 AM
Hi @priyanka1028,
Use the following syntax in the 'Default Value' of the 'Requested For' variable as shown below:
javascript:gs.getUserID = '';
Please note, there is no easy way (or something that is ideal from a performance perspective) where you can set this across all Items. Unfortunately, a Global UI Script would run on every form (not just catalog items), so it would be better to implement across each item.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie