Salesforce OData calls may be slow, resulting in timeouts and other errors such as an “A Task was Cancelled” error. It may take 20 to 40 seconds for a response. Salesforce sends an entire object collection via OData (not just the requested data) and that object collection is then filtered to get the data requested by the SmartForm or workflow.
To work around this performance issue, you can use the Salesforce REST API instead, since it performs faster than the ODATA API. You can create a K2 REST Service Instance that connects to your Salesforce Connected Apps REST API. You then create your Salesforce SmartObjects using the REST service and use these SmartObjects in your K2 solutions.
For background information on integrating with REST services in K2, please see K2 REST Endpoint in the K2 User Guide
There are three main steps to create a SalesForce REST Service Instance:
Follow these steps to configure your Salesforce Connected App:
Follow these steps to create a new Salesforce Feature Instance in K2. Creating a Feature Instance will create an OAuth resource in your K2 environment that you can use when registering a Service Instance fo the REST Service Type.
A Salesforce Service Instance is created.
Create a REST Service Instance, and use the Salesforce OAuth resources that were created when you set up the Salesforce Feature Instance. You will need to provide a link to a Swagger file that represents the SalesForce entities you want to work with. Refer to the sample Salesforce swagger json file to get started.
Once you have generated or created SmartObjects for your SalesForce REST Service Instance, you can use them in forms and workflows.