OFAC Automation
Identify the records on which you want to run the OFAC Check.
Create Request Wrapper using the below Attributes:-
creditchecker.WSOFACScreeningService.OFACRequestWrapper oReqWrapper = new creditchecker.WSOFACScreeningService.OFACRequestWrapper(); oReqWrapper.sFirstName = <First Name in case of Individual Search>; oReqWrapper.sLastName = <Last Name in case of Individual Search>; oReqWrapper.sType = <Individual or Entity>; 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 Id of the Record to which youw ant to Link the OFAC Record>
Pass the Request Wrapper to the API call which will return a Response Wrapper
creditchecker.WSOFACScreeningService.OFACResponseWrapper oResponseWrapper = creditchecker.WSOFACScreeningService.callOFACService(oReqWrapper);
At last, you need to call our Below Apis to Store the OFAC Results inside Salesforce
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.
Â