Hi, how can I use script to prompt a user to confirm an action when a button is clicked on the interface? The Button is linked to a record picker on a Blank Layout.
I tried adding this to my script:
// Ask for confirmation
let confirmed = await input.buttonsAsync(
"Are you sure you want to perform this action?",
[ {label: "Cancel", value: "cancel"}, {label: "Confirm", value: "confirm"} ]
);
if (confirmed !== "confirm") {
output.text("Action canceled.");
return;
}
But I am getting this error:
Property 'buttonsAsync' does not exist on type '{ config(): { readonly recordID: string; }; }'.(2339)
Here is my script:
let table = base.getTable("Test Log");
let view = table.getView("New");
const recordID = input.config().recordID;
let record = await view.selectRecordAsync(recordID);
// Ask for confirmation
let confirmed = await input.buttonsAsync(
"Are you sure you want to perform this action?",
[ {label: "Cancel", value: "cancel"}, {label: "Confirm", value: "confirm"} ]
);
if (confirmed !== "confirm") {
output.text("Action canceled.");
return;
}
if (record) {
// Perform action
}


