How do I map a custom object field in Customer Data Management to pull credit limit from Account Receivables using Application Composer?

Use this topic to learn how to extract the credit limit from Account Receivables using Application Composer.

You can write a Groovy script to call the API and retrieve the credit limit in a custom field. If you're defining this field as a formula field, you must set this value programmatically in a persistent custom field because a formula field might have some performance impact.

Here's an example:

/** Account Credit Limit **/
try
{
   def accountNumber = getAttribute("LegacyAccountNumber_c");
   println("Account Number :"+accountNumber)
   if(accountNumber != null){
      def customerProfile =
      [
         AccountNumber:accountNumber
      ]
   def custProfileValue = adf.webServices.FA_OCF_Account_Profile_Service.getActiveCustomerProfile(customerProfile)
      if(custProfileValue != null){
      println("custProfileValue:"+custProfileValue)
      println("Account creditLimit:"+custProfileValue.Value.CreditLimit)
           return custProfileValue.Value.CreditLimit.first().first()
      }
   }
}
catch (Exception e)
{
 println "Message: " + e.getMessage();
 println "Localized Message: " + e.getLocalizedMessage();