Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This document describes the steps to automate P2 Container Request via Flow.

  1. Under the Invocable class, one need to create a wrapper by setting the following attributes as per requirement:-

    public class P2ContainerRequestWrapper {
        public String sParentRecordId {get;set;}
        @AuraEnabled public String sTemplateName {get;set;}
        @AuraEnabled public String smsBody {get;set;} 
        @AuraEnabled public String emailSubject {get;set;} 
        @AuraEnabled public String emailBody {get;set;} 
        @AuraEnabled public String defaultMessage {get;set;}
        @AuraEnabled public datetime lastOnline {get;set;}
        //Add another Object to Allow Multiple Recipient
        @AuraEnabled public List<Recipient> recipients {get;set;}
        public class Recipient{
            @AuraEnabled public String firstName {get;set;} 
            @AuraEnabled public String lastName {get;set;} 
            @AuraEnabled public String email {get;set;} 
            @AuraEnabled public String phone {get;set;} 
            @AuraEnabled public List<RecipientItem> recipient_items {get; set;}
            @AuraEnabled public Boolean isTFAEnabled {get;set;}
            @AuraEnabled public String tfaMethod {get;set;}
        }
       
        @AuraEnabled public String firstName {get;set;} 
        @AuraEnabled public String lastName {get;set;} 
        @AuraEnabled public String email {get;set;} 
        @AuraEnabled public String phone {get;set;} 
        @AuraEnabled public String modeOfCommunication {get;set;}  //Email, SMS or Both
        @AuraEnabled public DateTime expirationDate {get;set;} 
        @AuraEnabled public Boolean tfaRequire {get;set;} 
        @AuraEnabled public String tfaMethod {get;set;} 
        @AuraEnabled public Boolean enableTeamFeature {get;set;}
        @AuraEnabled public Boolean bAutomation {get;set;}
        public String requesterFirstName {get;set;} 
        Public String requesterLastName {get;set;} 
        
    }

Create an object of Wrapper and set all the required values

P2ContainerRequestWrapper oWrapper = new P2ContainerRequestWrapper();
oWrapper.sParentRecordId = <Record Id of the record to which the P2 Request will be linked to>

Serialize the wrapper using JSON.serialize method

String sWrapper = JSON.serialize(oWrapper);
cm_datatransfer.GlobalServices.createP2Container(String sWrapper);
  • No labels