- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 04:57 AM
I have a requirement to unlock the URL field on form load in portal. I tried using https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0815270. But click function is throwing Javascript console error. I need this requirement only for one catalog item. Is there a way to unlock URL field in portal?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 05:25 AM
this worked for me in portal; I hope you can enhance it further as per your requirement
Ensure you keep Isolate Script= False for your onLoad catalog client script and set UI Type= Portal
function onLoad() {
setTimeout(function() {
var variableName = "my_url"; // give your variable name here
var inputTag = this.document.getElementById("sp_formfield_" + variableName + "_unlock");
inputTag.click();
}, 3000);
}
Output:
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 05:03 AM
that link seems for native and not for portal.
did you try setting the property to true?
'Unlock empty URL fields on form load' (glide.ui.unlock_empty_url)
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 05:10 AM
Hi @Ankur Bawiskar ,
Thank you for the response.
Yes I tried by activating that property its working fine, but I don't want to apply this changes for all the other catalogs.
Can you help me with this?
Thanks,
Ashwini.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 05:27 AM
I shared solution below; check that
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 05:14 AM
seems that property only works for classic and not for portal
you might have to use DOM manipulation there
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader