How to call an Integration procedure from LWC
Enable a custom Lightning web component to interact with OmniScript by extending the OmniScriptBaseMixin component. The OmniScriptBaseMixin includes methods to update OmniScript's data JSON, pass parameters, and more.
Steps to follow:
In order to call the Integration Procedure the Custom LWCs extending the OmniScript Base Mixin must use the omniRemoteCall() function i.e., omniRemoteCall(params, boolean)
1. The first parameter of this method will be an object with the below properties:
So, it should be framed like the below:
领英推荐
const params = {
input: JSON.stringify(this.omniJsonData),
sClassName: '{this._ns}IntegrationProcedureService',//Example: sClassName:'omnistudio.IntegrationProcedureService',
sMethodName: 'test_RemoteAction', //this will need to match the VIP -> type_subtype
options: '{}',
};
2. The second parameter of the omniRemoteCall function is an optional boolean value which will be passed to the omniSpinnerEnabled variable.
Example syntax to use the omniRemoteCall method:
this.omniRemoteCall(params, true).then(response => {
window.console.log(response, 'response');
}).catch(error => {
window.console.log(error, 'error');
});
fter omniRemoteCall executes, the response callback returns an object containing the two properties' result and error.
Let's see the complete implementation in the below example:
const options = {
chainable: true, //Use chainable when an Integration Procedure exceeds the Salesforce CPU Governor limit.
useFuture: true,
};
const params = {
input: this.omniJsonDataStr,
sClassName: `${this._ns}IntegrationProcedureService`,
sMethodName: 'test_RemoteAction', //this will need to match the VIP -> type_subtype
options: JSON.stringify(options),
};