- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2023 06:45 AM
Hi,
I was hoping if I can get some help with the following:
I have a catalog reference type variable 'country'. From a list of 231 countries, I would like the user to see the default as USA and then have the ability to change it to another country.
I have tried inserting the sys id in the Default tab, it does not work.
If possible, am looking for a simple method.
Thank you for your time in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2023 08:06 AM
Hi @KS11 ,
Is there any UI Policy on the location field ?.
See after inactivating that particular UI Policy.
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 11:56 AM
Hi Shraddha,
It would work without the UI Policy for sure, but the cou try field is dependent on another field, so the UI Policy is a must.
Thank you for your help though!
KS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2023 07:15 AM
Hi @KS11 ,
Default Value will work only when you save the data.
Instead of that you can use the onLoad catalog Client Script as below.
Script :
function onLoad() {
//Type appropriate comment here, and begin script below
var userEnteredLocation = g_form.getValue('location'); //give the correct field name
if (!userEnteredLocation) {
g_form.setValue('location', '25ab9c4d0a0a0bb300f7dabdc0ca7c1c'); //give the correct USA Sys ID
}
}
Mark Helpful and accept the solution if it helps in solving your query.
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2023 07:42 AM
Hi John,
Thank you for the help, unfortuantely even this is not working. I tried your approach and Shraddha's approach, it just does not want to work.
I am wondering if my UI policy is preventing the script from running accurately?
Thanks
KS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2023 08:06 AM
Hi @KS11 ,
Is there any UI Policy on the location field ?.
See after inactivating that particular UI Policy.
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2023 07:22 AM
Hello @KS11
I have created one variable which is refer to the Country Table and kept the default value of the country as "Greece" by adding only sys_id in the default value section.
In the portal, the default country is visible and also ability to change the another country.
For your reference, please find below image :
Let me know if you have any question on this.
Please mark my answer helpful !
Appreciate your help !
Thank you.
Thank you.