---
schema_version: "1"
id: 56fba6c549589f0d63bed14a83b20a3d47b63df0fd9fe6716fded44731d729ea
title: Remote Calls (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_make_remote_calls_vlocity.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_make_remote_calls_vlocity.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: eb2b8a4ae959c49fc6df72f9a8e5b06605a61497cafed1336c266277d6f2b878
description: For the managed package runtime, beginning with Vlocity Insurance and Health Winter '20 , enable users to make remote calls from a Custom LWC by using the omniRemoteCall() method.
products:
  - Omnistudio
release: "264"
---
# Remote Calls (Managed Package)

For the managed package runtime, beginning with Vlocity Insurance and Health Winter '20 , enable users to make remote calls from a Custom LWC by using the `omniRemoteCall()` method.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

Method: `omniRemoteCall(params, boolean)`

Arguments:

- The first argument must be an object with the properties input, sClassName, sMethodName, and options. The values of each of the properties must be in String data type.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)
    
    Note Methods called within a package must have the namespace prepended with ${this.\_ns}. For example, `` `${this._ns}IntegrationProcedureService` ``.
    
    ```
    const params = {
    	input: JSON.stringify(this.omniJsonData),
    	sClassName: 'SomeApexClass',
    	sMethodName: 'someApexMethod',
    	options: '{}',
    };
    ```
- The second argument for omniRemoteCall is an optional boolean value that links a tracked property called **omniSpinnerEnabled**. The HTML must have some code to check the boolean's value.
    
    Here’s an HTML example:
    
    ```
    <template if:true={omniSpinnerEnabled}>
          <div class="slds-spinner-container__wrapper">
            <c-spinner variant="brand"
                       alternative-text="Loading.."
                       size="medium">
            </c-spinner>
          </div>
    </template>
    ```

After omniRemoteCall executes, the response callback returns an object containing the two properties `result` and `error`.

- `result`: The result property contains a raw response from the server.
- `error`: The error property stores an error value from the Vlocity's GenericInvoke2 class.

Vlocity provides properties that, when passed in the options, enable jobs to be queuable, future, chainable, and continuable.

![Use Case Examples](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_example.png)

Use Case Examples

- Remote call invoking an Apex class
    
    ```
    const params = {
    	input: this.omniJsonDataS,
    	sClassName: 'SomeApexClass',
    	sMethodName: 'someApexMethod',
    	options: '{}',
    };
    
    this.omniRemoteCall(params, true).then(response => {
    	window.console.log(response, 'response');
    }).catch(error => {
    	window.console.log(error, 'error');
    });
    ```
- Integration Procedure call
    
    ```
    const params = {
    	input: this.omniJsonDataStr,
    	sClassName: `${this._ns}IntegrationProcedureService`,
    	sMethodName: 'test_RemoteAction', this will need to match the VIP -> type_subtype
    	options: '{}',
    };
    
    this.omniRemoteCall(params, true).then(response => {
    	window.console.log(response, 'response');
    }).catch(error => {
    	window.console.log(error, 'error');
    });
    ```
- Chainable Integration Procedure call passing the property `chainable: true`. Use chainable when an Integration Procedure exceeds the Salesforce CPU Governor limit.
    
    ```
    const options = {
    	chainable: 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),
    };
    
    this.omniRemoteCall(params, true).then(response => {
    	window.console.log(response, 'response');
    }).catch(error => {
    	window.console.log(error, 'error');
    });
    ```
- Queueable remote call passing the property `useQueueableApexRemoting: true` . For more information on how queueable works, see [Queueable Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm).
    
    ```
    const options = {
    	input: this.omniJsonDataStr,
    	vlcClass: 'SomeApexClass',
    	vlcMethod: 'someApexMethod',
    	useQueueableApexRemoting: true,
    };
    const params = {
    	input: this.omniJsonDataStr,
    	sClassName: `${this._ns}VFActionFunctionController.VFActionFunctionControllerOpen`,
    	sMethodName: 'runActionFunction',
    	options: JSON.stringify(options),
    };
    
    this.omniRemoteCall(params, true).then(response => {
    	window.console.log(response, 'response');
    }).catch(error => {
    	window.console.log(error, 'error');
    });
    ```
- Future remote call passing the property `useFuture: true`. For more information on how Future Methods work, see [Future Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_invoking_future_methods.htm?).
    
    ```
    const options = {
    	useFuture: true,
    };
    const params = {
    	input: this.omniJsonDataStr,
    	sClassName: 'SomeApexClass',
    	sMethodName: 'someApexMethod',
    	options: JSON.stringify(options),
    };
    
    this.omniRemoteCall(params, true).then(response => {
    	window.console.log(response, 'response');
    }).catch(error => {
    	window.console.log(error, 'error');
    });
    ```
- Continuation remote call passing the parameter `useContinuation: true`. For more information on how continuation works, see [Continuation Class](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_Continuation.htm).
    
    ```
    const options = {
    	input: this.omniJsonDataStr,
    	vlcClass: 'SomeApexClass',
    	vlcMethod: 'someApexMethod',
    	useContinuation: true,
    };
    const params = {
    	input: this.omniJsonDataStr,
    	sClassName: 'SomeApexClass',
    	sMethodName: 'someApexMethod',
    	options: JSON.stringify(options),
    };
    
    this.omniRemoteCall(params, true).then(response => {
    	window.console.log(response, 'response');
    }).catch(error => {
    	window.console.log(error, 'error');
    });
    ```