Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Facade.saveTrackedObject(object description)

          Facade.saveTrackedObject(object description)

          This asynchronous method immediately commits the changes to an object when a save action is triggered in the Consumer Goods (CG) Cloud offline mobile app.

          Required Editions

          Available in Lightning Experience in Professional, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled.

          This method is used when an object defined in the Salesforce backend (referred to as Salesforce objects here) to be saved matches with multiple CG Cloud offline mobile app business objects and vice versa.

          Parameters

          object description: The information of the object intended to be saved.

          The object information includes the following parameters:

          • changeType: Indicates the object change status and can have the following values: N: Indicates that the object is to be newly created. U: Indicates that the object is to be updated. D: Indicates that the object is to be deleted.
          • data: Refers to the actual data to be saved in JSON format.
          • idAttribute: Refers to a unique key attribute within a Salesforce object.
          • idProperty: Refers to a unique key attribute within a business object.
          • name: Refers to the name of an object defined in the Salesforce backend.
          • mapping: Refers to the mapping between the simple property names of a business object and the attribute names of a Salesforce object.

          Returns

          The method returns a promise (without any information).

          Example

          
          promise = Facade.saveTrackedObject({
          name: mapping.tableName,
          idAttribute: mapping.idColumn,
          idProperty: mapping.idProperty,
          mapping: mapping.columnMapping,
          changeType: changeType,
          data: data
          }).then(function () {
          return when.resolve(true);
          });
          
           
          Loading
          Salesforce Help | Article