How to add a field of 'Approval' on a form to allow user to manually add approvers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2017 12:01 AM
I would like to have a grid sort of thing to be displayed in a form, and it will show approvals generated automatically by workflow, and also allow user to manually add additional approvers.
DO I need first create a relationship, and add a column ( which type) to the table, and then add the field to the form?
Could someone shed some light on this?
Many thanks
Frances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2017 12:40 PM
When you have a approval activity in the workflow and give the approvers,it lists on the form in the related lists(approvers section) by default.So to let the user add additional approvers,you need an UI action.Maybe in that you can access the table and add the approvers to it. It should be a reference type to sys_user table as approvers are employees.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2017 10:46 PM
Thank you very much for replying.
I think I have three things not quite right yet.
First I created the relationship to 'sysapproval_approver' with the following script:
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval',current.number);
But I see all rows from 'sysapproval_approver' table, rather than only the rows matching the current Document number.
My second question is how I can then move the related links to a section on the form. At the moment it is at the bottom of the form.
Lastly, I don't know how to add UI action to allow user to add approvers.
Thanks again
Frances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 07:31 AM
Hi
See that if the current.number is giving the RequestedItem number(like RITM) and as the sysapproval is a reference field to task,I guess it should be as 'sysapproval.number' in addquery() statement. //Add log statements and see what it is returning exactly
And when you create a UI Action,there will be options in the form that has to be checked for displaying the UI Action on the form like Form Button,List Link. So you can choose where you need it.
You need to write a script in UI Action something like
var g=new GlideRecord('sysapproval_approver');
g.addQuery('sysapproval.number',current.number); //not sure of this,please use log statements and check what it is returning
g.approver=' sys_id of approver'; //as approver column is reference to sys_user table
g.update();
Let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 11:51 PM