UI Builder Add comments to Approval record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2023 09:55 AM
Hi Everyone,
As part of a requirement, we had to add the input entered in a Textarea component as a comment on Approval table (sysapproval_approver) when they click on a Button. I'm able to get the text entered in the textarea and On click of the button, I'm trying to add it as comment via "Update Record", I am not able to find "Comments" in the list of fields and I also tried using the script. Even though I'm getting all the values, For some reason it's neither saving the state nor adding comment
function handler({api,event, helpers, imports}) {
let fields ="state=" + event.payload.status+"^comments="+api.state.reason;
api.data.update_record_1.execute({
table: "sysapproval_approver",
recordId : api.context.props.sysId,
templateFields: fields, //state=rejected^comments=test
useSetDisplayValue: false
});
}
Appreciate the help in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2023 06:44 AM
I don't see anything wrong with this, but the fact that there are no fields available when you try to set this through the UI probably isn't a great sign. If you hardcode the field property with the string you've commented out does it work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 11:11 PM
Hi @Goutham9 ,
Did you find any solution for that?
Actually, I am also trying to add comments to a case when user click the button component.
If you got any solution then please reply.
Regards,
MrGupta__