Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 09:08 AM
Hi,
I have below code in the client script to delete the record. when list simple row is clicked, but delete operation is giving the error. looking to some help to fix this issue.
/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
* @Param {any} params.imports
* @Param {ApiHelpers} params.helpers
*/
function handler({api, event, helpers, imports}) {
try {
console.log(JSON.stringify(event.payload, null, 4));
api.data.delete_record_1.execute({
'table': event.table,
"recordId": event.sys_id
});
console.log("Delete completed");
}catch(ex){
console.log("Error: " + ex);
}
}
Generate this error:
event :{"elementId":"delete_record_1","name":"DATA_OP_FAILED","payload":{"dataElemId":"delete_record_1","operation":"EXECUTE","errors":[{"message":"Invalid syntax with ANTLR error 'token recognition error at: '.a'' at line 2 column 7","errorType":"InvalidSyntax","locations":[{"line":2,"column":7}]}],"__uxfCompositionElId":"9c830cf88310a250bef196a6feaad362"},"context":{},"eventInfo":{"sourceElementId":"cm9a424ye00013j9cmmt8s35a"}}
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 09:20 AM
sorry, found the issue. I am missing payload to get the dynamic values. below works.
api.data.delete_record_1.execute({
'table': event.payload.table,
"recordId": event.payload.sys_id
});
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 09:20 AM
sorry, found the issue. I am missing payload to get the dynamic values. below works.
api.data.delete_record_1.execute({
'table': event.payload.table,
"recordId": event.payload.sys_id
});