UX client script is not working on all records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 01:30 PM
Hello, I have UX action to make changes on a field through UX client script for selected records in the table list in UI builder workspace, it is working when I select records on current page and select records through select all records check box, but it is not triggering when I select all records in the list through "select all records" option.
function handler({
api,
event,
helpers,
imports
}) {
var parent = api.state.srcCase;
var selectedRec = api.state.selectedObj;
var table = api.state.table;
if (selectedRec.length > 0) {
for (var i = 0; i < selectedRec.length; i++) {
var test = api.data.apiname.execute({
"table": table,
"recordId": selectedRec[i],
"templateFields": "removed=true"
});
}
helpers.navigate.to("record", {
"table": "table_name",
"sysId": parent
});
}
}