Creating a Flow to update Access Keys for custom objects
To update Access Keys for your custom objects, add an Access Key field to your custom object then create a flow to handle the key updates:
Notes:
- The user creating the Flow must have Access permission to the TargetX_Base.Access class.
- This flow should only be used for Unmanaged Custom objects.
- Managed objects should NOT be included because the upgrade automatically generates Access Keys or when new records are created.
- Navigate to Setup and search for Flow.
- Click New Flow.
- Choose Start from Scratch.
- On the Select Type page, choose Record-Triggered Flow; and click Create.
- In the Select Object picklist, select the object where the Access should be updated.
- Set Configure Trigger to trigger the Flow when a record is created.
- In Set Entry Conditions, select the following options:
- Condition Requirements = None
- Optimize the Flow for: select Actions and Related Records.
- Click + below the Start element
- In the Add Element search box, type Action and select it.
- Search for Create Access Key and select Create Access Key (apex-Access).
- Enter the following:
- Label: Create Access Key Action
- API Name: Create_Access_Key_Action
- Under Set Input Values for the Selected Action section, enable sObjectIds.
- For sObjectId, click within the text box and scroll to the bottom of the popup to select Triggering <object> eg., Triggering MyCustomObject.
- Scroll to the Record Fields of the object within the popup and select Record Id for your custom object.
- Click the Save button.
- In Save the Flow popup, set the following (replacing the items in < > with your custom object) and click Save:
- Flow Label: Create <Sobject> Access Key (eg., Create <object> Access Key)
- Flow API Name: eg., Create_<object>_Access_Key
- Click Activate at the top right corner of the builder.
Run Access Key Update in Base Settings for Custom objects
To update existing Access Keys for your custom objects, run the Access Key Update in Base Settings:
- Note your Salesforce URL up to the salesforce.com. Example: https://na10.salesforce.com
- Append /apex/TargetX_Base__baseSettings to the URL.
Example: https://na10.salesforce.com/apex/TargetX_Base__baseSettings
- Locate the Access Key Update section.
- Enter your Object API Name and choose Update Access Key.
- Check the status of the job by navigating to Setup and searching for Apex jobs.
- Look for the UpdateAccessKeys Apex job.