Change UI action button label
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 04:16 AM
I have a UI action named "Create ID", now I just need to change the display name to "Generate ID" without altering the UI action name field.
is there any methods to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 04:25 AM
Not recommended way but you can try below:
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 04:22 AM
Hi @XYD23
Atlast it will store in Name field only. So better change the name.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 04:24 AM
Can you help me lets try it once?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 04:26 AM
Hi @Anil Lande need your coding skill here.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
While it's not a great idea, this is absolutely achievable without messing about with a script include which was mentioned elsewhere in this thread.
For example, in our instance we've added a u_approval_type field to the sysapproval_approver table. In it we have types such as 'endorsement', or 'approval'. Our business case was to change the label of the Approve button to Endorse, should the approval type be an endorsement. They also wanted the 'Reject' button to say 'Not Endorsed'.
We could create new buttons and show them on the form using the condition logic on the UI Action, then hide the buttons we don't want, or we can simply change the label.
As the u_approval_type field is not showing on the form itself, we added it to the scratchpad so it can be referenced in an onLoad client script.
E.g. Display Business Rule on the approval table: g_scratchpad.approvalType = current.getValue('u_approval_type');
You then need to get the button id of the UI Action. While looking at an approval, open the browser's Dev Tools and inspect the element. You'll find the sys_id there, along with the ID (as we had a view which only showed the bottom buttons our IDs reflected this).
The code we used in the onLoad client script is:
function onLoad() {
var approvalType = g_scratchpad.approvalType;
if (approvalType === 'endorsement') {
var approveBtn = document.getElementById('approve_bottom');
var rejectBtn = document.getElementById('reject_bottom');
if (approveBtn) approveBtn.textContent = 'Endorse';
if (rejectBtn) rejectBtn.textContent = 'Not Endorsed';
}
}

