Xero Contact Flow
This is an example of the Invocable Method generated by Breadwinner Apex Generator, which a standard Flow can invoke. This is useful as it shows how you can use Salesforce standard automation practices to drive Xero Contact record creation. Using this format, you can extend to Update or Read similarly.
This primary use case shows how easy it is to create robust automation in Salesforce to facilitate Xero Contact record creation in Breadwinner for Xero Application. Extending upon this, using the Global API requests in this help site, you can perform many automated retrieves, create, or update functions directly rather than requiring extensive middleware or endpoint processing to perform.
Step 1: Create a “Send to Xero” custom field of Checkbox Data Type on the Account object.
Navigate to Breadwinner Setup > Tools > Apex Generator
Step 2: Choose the record mode Create on a Xero Contact using a Flow. Step 3: Select the option for Run this Flow (I will check "Run Asynchronously").
Step 4: Click on Next. It will navigate to the Fields selection page. Click on Generate Apex.
Step 5: Copy the generated Apex Class / Apex Test(optional) Class. Save/Deploy the copied code to the respective org.
Step 1: Navigate to Salesforce Setup > Flows > New Flow > Record-Triggered Flow
Step 2: Choose the options similar to those mentioned below, and click on Done. 1. Select the Object (Account) 2. Trigger Event (the record is created or updated) 3. Entry Conditions (like “Send to Xero” is True) 4. Check "Only when the record is updated to meet the condition requirements" 5. Optimize Flow for (Actions and Related Records) 6. Check the Run Asynchronously path (Only when the option "I will check "Run Asynchronously" (on Record-Triggered flow creation Page)" on Step 3)
Step 3: Create an Apex Action using the "Create Xero Contact" Invocable method.
Step 4: Map the Fields to Create Xero Contact in "Apex Action".
Step 5: Connect the Flow Steps, Click Save, and Activate.
- Connect Record Trigger Flow Section to Apex Action (Run Asynchronously)
When you check the “Send to Xero” checkbox field in Account, it will create a Xero contact record with all the mapped fields in Salesforce and Xero.
Step 1: Select an Account/Create New Account.
Step 2: Edit the Account to meet Trigger Criteria (Check the “Send to Xero” field) and give the other mapped field details.
Step 3: Evaluate the created Xero contact.