Setting up SPTM Approvals
Overview
This section lists the procedure to set up SPTM disclosure approvals.
Prerequisites
The following permission set must be granted to the users who are disclosure owners:
GPM_SPTM
To set up SPTM approvals
- Add new picklist value <namespace>__MnLegislationReport__c to Main Object (REVVY__MainObject__c) field in the Approval Process Definition (REVVY__MnApprovalDef__c) object
- From the User menu, choose Setup.
- Enter Object in the Quick Find option and press ENTER.
- Click Object Manager.
- Locate and click the Approval Process Definition (REVVY__MnApprovalDef__c) object.
- Locate and click the Main Object (REVVY__MainObject__c) field. If the field does not exist, create the Main Object field.
- Click New in the Values section and add <namespace>__MnLegislationReport__c as a new picklist value.
- Create Approval Process Definition record to support approval for SPTM disclosures with Main Object field value as <namespace>__MnLegislationReport__c and make it active.
Follow https://helpcenter.modeln.com/124720Cross-Industry_Products/127020Intelligent_Approvals/127030Building_an_Intelligent_Approvals_Process documentation to configure approval definition for <namespace>__MnLegislationReport__c.
- Make sure the Entry Criteria has the Target Field as ApprovalStatus__c, Value as Draft/Collaboration/Rejected/Recalled, and Condition as OR.
- Make sure you add the required Approval Steps.
For example, you can have two steps and the Approver Type can be Group, and Approver can be Public Group Name.
Model N recommends that you add approvers of one step to a public group and assign the public group as approver.
The following predefined public groups are provided out-of-the-box:
SPTM_Level1_Approvers, SPTM_Level2_Approvers, and SPTM_Level3_Approvers. - Make sure to define actions at approval process record level.
For example,- Approval Status field update “Pending Approval“ on “Initial Submission”
- Approval Current Level field update “1“ on “Initial Submission“
- Approval Status field update “Approved“ on “Final Approval“
- Approval Status field update “Rejected“ on “Final Rejection"
- Approval Status field update “Recalled“ on “Recall Submission“
- Approval Current Level field update “1“ on “Recall Submission“
- Configure apex class as Plugin on <namspace>__LegReportApprovalSubmissionPlugin to populate “Submitter” and “Submitted Date“ as follows:
global class LegReportApprovalSubmissionPlugin implements
REVVY.IMnAdvApprovalActionPlugin {
public void doAction(Id mainObjectId, Map<String, String> values) {
System.debug(LoggingLevel.INFO, 'LegislationReportApprovalSubmissionPlugin#doAction#mainObjectId#' + mainObjectId + '#values#' + values);
<namespace>__MnLegislationReport__c report = [SELECT Id, <namespace>__SubmittedDate__c, <namespace>__Submitter__c FROM <namespace>__MnLegislationReport__c WHERE Id = :mainObjectId limit 1];
if (report != null && report.<namespace>__SubmittedDate__c == null) {
report.<namespace>__Submitter__c = UserInfo.getUserId();
report.<namespace>__SubmittedDate__c = System.now();
update report;
}
}
}
IMPORTANT: If your org does not have a namespace, replace <namespace> with __ in the approval process while configuring plugin.
- Make sure to define appropriate actions at each Approval Process Step level as follows:
Approval Current Level field update to increment by 1 on “Step Approval“ - Configure email templates to notify users in the approval flow as needed.https://help.modeln.com/60_Cross_Industry_Revenue_Cloud_Products/Intelligent_Approvals/186_Spring_19/Building_an_Intelligent_Approvals_Process/Setting_Up_Email_Templates_and_Email_Actions
Make sure to create email templates for all available stages/user types in the flow like submitter for submission, pending for approvers, approved for submitter, and so on.
You can create in any folder but recommended folder is MnEmailTemplates. - Make sure to assign “Submitters“ permission set to the users who can submit records for approval.
- Make sure to assign “Approvers“ permission set to the users who can take action in approval flow.