update Records based on click on Hyperlink
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
I am having field which has having external Link . Requirement is when ever user click that link it should trigger some script to update records in table.
Not sure how I can do that as per my understanding client script will not work here.
Let me know if you have any suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago - last edited a week ago
Hi @dsf3 ,
You can achieve this using a UI Macro and UI Page combination.
-
Create a UI Macro and add it to the field using:
ref_contributions=UI Macro name -
In the UI Macro, render the hyperlink and pass the URL.
-
On click, open a modal dialog (UI Page).
-
In the UI Page, write server-side logic to update the required records.
-
After the update, redirect the user to the external URL if needed.
This approach allows you to safely execute server-side updates when the link is clicked.
Thanks and regards,
Siddhesh Jadhav
If this resolves your query, please mark this response as Helpful and Accepted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
HI Siddhesh,
Thanks for your response and suggestion. Could you please help with sample code for UI macro. I dont have much idea on UI macro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
so the field type is URL and it has some link
I don't think clicking that LINK should lead to some database operation and doesn't look like a valid business requirement.
user can click link multiple times leading to multiple updates which is not good for performance
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
