- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 05:08 AM
When approval status is set to 'requested' manually on project task , approval should go to project manager,
I have written a business rule to generate a approval:
var app = new GlideRecord('sysapproval_approver');
app.initialize();
app.sysapproval = current.sys_id;
app.document_id = current.sys_id;
app.approver = current.parent.project_manager;
app.state = 'requested';
app.insert();
Also tried from workflow, but document id field is not getting populated. Please help me wth this issue.
Solved! Go to Solution.
- Labels:
-
Project Portfolio Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 05:35 AM
Hi ,
Here is a link which will help you.
If it helps,Please mark ✅ Correct and 👍 Helpful.
Warm Regards,
Milind

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 05:20 AM
can you remove this line app.document_id = current.sys_id. That is calculated based on the disapproval field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 05:28 AM
then how do I populate approval for field?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 05:30 AM
I just took your code took at that piece of code and add it to a business rule and it worked for me
*you will have to add in the approvers related list to see that tab
I would recommend not using this method. I would go with doing this with Flow or workflow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 05:33 AM
this line of code does that
app.sysapproval = current.sys_id;