Ui Actions

Ram012
Tera Contributor

An one Approver i would like the next back buttons visible to all users if there are more records than can be shown one page i would also like the approvals tab default list is sorted by request id ascending.

 

Note : Two persons like X , Y .

 

1. X person can see the buttons & Y person i cannot so it is not consistant.

 

Above Example task using ui action but not working .

 

Any idea help me with code.

2 REPLIES 2

amaradiswamy
Kilo Sage

Hi @Ram012 

 

Can you check the conditions field on UI action which restrict the visibility? Also, under related list you can control the UI action visibility based on roles under "UI Action visibility" related list.

 

If you can share the UI action screenshots, then it will be easy to understand the issue

Ram012
Tera Contributor


Client Script (onLoad):


function onLoad() {
var ga = new GlideAjax('global');
ga.addParam('sysparm_name', 'getRecords');
ga.addParam('sysparm_table', 'sc_request');
ga.addParam('sysparm_query', 'ORDERBYrequest_id');
ga.getXML(function(response) {
var records = response.responseXML.documentElement.getElementsByTagName('record');
// Process records to update display
});
}


Alternatively, use a Catalog Client Script:

Make buttons visible to all users (Server-side):

Create a Business Rule:


function onDisplay() {
// Check if next/previous buttons should be visible
if (current.page > 1 || current.page < total_pages) {
g_form.setDisplay('next_button', true);
g_form.setDisplay('previous_button', true);
}
}