- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2019 06:23 AM
Hi All ,
In Related Lists, i have a field called "Approvers".
In the project change Request form , i need to create a button "Request Approval" .
When any user clicks on "Request Approval" button , then it should go for the Approval .
Ex: If i select Assignment Group as "IT" then Approval should go for all the users who are part of "IT" Group.
I need to see all the user Names under -> Approvers ( Related Lists ) .
How can i achieve this ?
Can you please help me with the code .
Thanks
NR.
Solved! Go to Solution.
- Labels:
-
Project Portfolio Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2019 07:25 AM
Create a ui action.
var group = new GlideRecord('sysapproval_group');
group.initialize();
group.assignment_group = current.assignment_group;
group.approval = 'requested';
group.parent = current.sys_id;
group.insert();
action.setRedirectURL(current);
You can put condition based on requirement.
Regards,
Mandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2019 06:30 AM
How you are going to select assignment group for approval?
if you have any pop up ui page for selecting group, then you must create a script to insert group approval record and set state to requested. it will automatically load the list of approvers in the related list based on group membership.
Generally approvals are generated through workflow.
Regards,
Mandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2019 06:38 AM
Hi Karan ,
I agree that approvals are generated through workflow.
Here client is saying not to user workflow.
Requirement is :
When user selects the Assignment Group "IT" or "Cab" ... Etc and clicks on "Request Approval" button , then under related lists -> Approvers ( They should see all the users who are part of the Group ) .
Then they will open the record and Approve .
How should i populate the users under "Approvers" .
Thanks
NR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2019 07:25 AM
Create a ui action.
var group = new GlideRecord('sysapproval_group');
group.initialize();
group.assignment_group = current.assignment_group;
group.approval = 'requested';
group.parent = current.sys_id;
group.insert();
action.setRedirectURL(current);
You can put condition based on requirement.
Regards,
Mandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2019 12:56 AM
Hi Karan ,
Thanks for the script , i have used your script and made some changes , its working now.
Thanks
NR.