OmniScript Best Practices
When feasible, adhere to the OmniScript best practices to improve OmniScript’s functionality and usability.
- Include a description of an element’s function in its Internal Notes attribute.
- By preventing element name changes, you can maintain DataRaptors and Apex classes. Apply the name modifications to the DataRaptor or Apex class if the element name has to be altered.
- You should refrain from giving the OmniScript a ContextId. The ContextId reserved key in OmniScript assigns a Record Id based on the URL.
- Create reusable OmniScripts and add them to the relevant parent OmniScripts when procedures can be repeated across numerous scripts.
- Use the Newport Design System to implement global branding.
- Use one owner for each OmniScript.
- Create a skeleton of the entire OmniScript to identify reusable elements.
- Prefilling the forms with contextual data will reduce the amount of fields the user must fill out.
- Processes should be divided into simpler steps with fewer components to avoid confusing the user.
- Create contextual help text and logically order input fields to assist the user.
- Trimming the Response JSON will hasten the application of responses.
- Eliminate spaces from element names to speed up the loading of OmniScript.
- The script’s element count should be decreased. 200 items is the maximum that should be in one OmniScript.
DataRaptor Best Practices
When using DataRaptors, always adhere to the recommended procedures.
- Make specific DataRaptors that exclusively load or extract the data required for a single task.
- When retrieving data from other SObjects, use relationship notation (queries) whenever possible.
- DataRaptors that get information from the parent of the primary sObject perform better when relationship notation is used.
- Instead of adding a second sObject in the DataRaptor’s Extract tab, you have to use relationship notation in the Extract JSON Paths for the parent sObject’s fields. Only child-to-parent relationship queries are supported by DataRaptors.
- Keep the number of SObjects to three or less.
- Make certain that all filtering and sorting (ORDER BY) operations are performed on indexed fields.The Id and Name fields are always indexed.
- Caching can be used to store frequently accessed but infrequently updated data.When you call a DataRaptor from a caching Integration Procedure, the DataRaptor data is cached alongside the Integration Procedure data.
Integration Procedure Best Practices
Follow best practices whenever possible to reap the effectiveness of Integration Procedures.
- For all data calls to Salesforce, use the integration procedures.
- Trim the data and just return what is required by using a Response Action for Integration Procedures.
- To allow an Integration Procedure to exit early under appropriate conditions, use multiple Response Actions with different Execution Conditional Formulas.
- Caching can be used to store frequently accessed but infrequently updated data.
- Call Integration Procedures with below settings to run data operations asynchronously.
- Use
Future– You can use this method if completion time is not crucial and the calling OmniScript or Integration Procedure doesn’t require a response. - Invoke Mode: Fire and Forget – When the calling OmniScript must immediately invoke the Integration Procedure, use this method instead of Use Future.
- Invoke Mode: Non-Blocking – Use this method to run the Integration Procedure immediately while continuing the user interaction of the calling OmniScript. When the Integration Procedure is finished, a response is given.
- Use
Hope this information helps you guys.
Cheers!!!
Mukul Sharma