BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
49 / 81 · Module 14 — External Automated Testing of Mule Integrations · filtered: interview← prev⊞ allnext →

14.9A good reusable Salesforce helper

Conceptually:

async function findAccountByExternalId(
  request,
  customerId: string
) {
  const soql = `
    SELECT Id, Name, Phone
    FROM Account
    WHERE External_Customer_ID__c = '${customerId}'
  `;

  // Salesforce API query here
}

In real code, avoid unsafe string concatenation when user-controlled values are possible; encode/query appropriately.

The test intent is:

query target state directly