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 = oAccount.FirstName + ' ' + oAccount.LastName;new 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 or sTypeEntity>; 
    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);
  4. At last, you need to call our Below Apis to get the result:-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. *The same code will work in Batch as well in Triggers.