Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  1. Identify the records on which you want to run the OFAC Check.

  2. Create Request Wrapper using the below Attributes:-

    Code Block
    String sIndividualNamecreditchecker.WSOFACScreeningService.OFACRequestWrapper oReqWrapper = new oAccount.FirstName + ' ' + oAccount.LastName;creditchecker.WSOFACScreeningService.OFACRequestWrapper();       
    oReqWrapper.sFirstName = oAccount.FirstName <First Name in case of Individual Search>; 
    oReqWrapper.sLastName = oAccount.LastName <Last Name in case of Individual Search>; 
    oReqWrapper.sType = <Individual sTypeor Entity>; 
    System.debug('oReqWrapper.sType :::>'+oReqWrapper.sType); 
    oReqWrapper.sName = sIndividualName; 
    System.debug('oReqWrapper.sName :::>'+oReqWrapper.sName); oReqWrapper.sName = <Individual Name or Entity Name depending on the type of Search>;
    oReqWrapper.sEntityName = <Entity Name in case of Entity Search>;
    oReqWrapper.sParentRecordId = <Parent oAccount.Id; //oReqWrapper.sCountryCode = 'United States';
    After this, you need to store the response which you will get
    Id of the Record to which youw ant to Link the OFAC Record>
  3. Pass the Request Wrapper to the API call which will return a Response Wrapper

    Code Block
    creditchecker.WSOFACScreeningService.OFACResponseWrapper oResponseWrapper = creditchecker.WSOFACScreeningService.callOFACService(oReqWrapper);
  1. At last, you need to call our Below Apis to

...

  1. Store the OFAC Results inside Salesforce

    Code Block
    creditchecker.Utility.storeOFACData(oResponseWrapper.oOFAC, oResponseWrapper.listOFACResults); 
    creditchecker.Utility.populateOFACMatchResults(new Set<Id>{oResponseWrapper.oOFAC.Id});

*Please note the above can be bulkified as well. You can get the list of OFAC Response Wrappers and store them in bulk.