- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 10:46 PM
Hello exparts!
I'd like to set a button on the input form and send an approval request to "Approver Group" by pressing the button.
How can i achieve this ?
Can you please help me with the code .
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 11:15 PM
What do you mean by input form, Are you talking about some record of table?
BTW here is the code to send the approval to particular group, you need to create a UI action server side and write this code mentioned below:
var approval = new GlideRecord('sysapproval_group');
approval.initialize();
approval.assignment_group = //pass the sys_id of group to whom you want to send Approval request
approval.approval = 'requested';
approval.parent = current.sys_id;
approval.insert();
action.setRedirectURL(current);
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 11:00 PM
Hi, can you clarify why you need custom code and cannot use OOB approval functionality?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 11:15 PM
What do you mean by input form, Are you talking about some record of table?
BTW here is the code to send the approval to particular group, you need to create a UI action server side and write this code mentioned below:
var approval = new GlideRecord('sysapproval_group');
approval.initialize();
approval.assignment_group = //pass the sys_id of group to whom you want to send Approval request
approval.approval = 'requested';
approval.parent = current.sys_id;
approval.insert();
action.setRedirectURL(current);
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 09:55 PM
@Prince Arora
Thank you for answer!
Your advice solved my problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 01:29 AM
Hi @Prince Arora ,
thanks for you hint, that help me too! I have only one addiditonal question. Is it possible to change the ui action coding that the agent pick only one approver from the group? E.g. I click on the UI Action Request approval and a seperat window will open with a drop down where I can choose one approver of this group...
Thanks a lot for your help,
Nicole