- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2018 02:32 AM
Hi,
I would like to change the name of a specific UI Action based on
For exemple on incident table, there is Create Problem UI Action ((OOB)
We need to keep this UI Action but change the name to Create Technical Problem when category of Incident is Technical.
I may duplicate the UI Action and add specific condition, but I would like to achieve this with onload Client Script
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2018 02:46 AM
Hi Pbo,
So you want the text of the UI action to change based on the category of incident. Also you don't want to create duplicate UI action with same functionality and have different text.
you can use onLoad client script and sample script below: in the part highlighted in bold search the document id of the button tag
function onLoad(){
if(g_form.getValue('category') == ''){
$j("#resolve_incident").html('Create Technical Problem'); // option 1
//$j("button:contains('Create Problem')" ).html('Create Technical Problem'); // option 2
}
}
If you don't want to rely on the document id since it may change whenever instance is upgraded then use option 2
Option 1: Perform search using document id
Option 2: Searches button with that text and then replace the text
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2018 02:46 AM
Hi Pbo,
So you want the text of the UI action to change based on the category of incident. Also you don't want to create duplicate UI action with same functionality and have different text.
you can use onLoad client script and sample script below: in the part highlighted in bold search the document id of the button tag
function onLoad(){
if(g_form.getValue('category') == ''){
$j("#resolve_incident").html('Create Technical Problem'); // option 1
//$j("button:contains('Create Problem')" ).html('Create Technical Problem'); // option 2
}
}
If you don't want to rely on the document id since it may change whenever instance is upgraded then use option 2
Option 1: Perform search using document id
Option 2: Searches button with that text and then replace the text
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 02:58 AM - edited 12-19-2023 02:58 AM
I am using solution 2 for the UI action name change on the Change request form, but it's not working
could you please check once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 03:54 AM
Could you raise a new question and tag me there by sharing all the details as this is an old thread?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2018 05:20 AM
Thanks
Solution 2 is perfect