Loading
Feature degradation | Gmail Email delivery failureRead More
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
          Standard Methods

          Standard Methods

          All business objects have both standard methods and customized methods. The standard methods are automatically available to all objects. For example, LoadAsync and DoValidateAsync.LoadAsync load the simple properties of an object from the database, and loads all nested objects of a business object recursively. DoValidateAsync validates the consistency of an object before it’s saved.

          Required Editions

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

          Other generated methods are CreateAsync, SaveAsync, and Initialize.

          You can explicitly activate or deactivate the automatic generation of load and create methods for an object by using the generateLoadMethod and generateCreateMethod attributes in a business object declaration. If you set these attributes to false, then you must implement the load or create functionality yourself in the automatically created beforeLoadAsync or beforeCreateAsync method. This is always the case for save, which is why there’s no generateSaveMethod attribute.

          No Standard Save Method

          There’s no generated save method because you must make save-related decisions on a case-by-case basis. For example, do you save all nested objects of an object as well? This explains why there’s a generateLoadMethod attribute in a BusinessObject method but no generateSaveMethod attribute.

          Instead, the framework generates before and after save method stubs for a new business object in the SaveAsync folder under the MvX directory. Always write the save logic yourself, typically in beforeSaveAsync.

          Note
          Note The examples of saveAsync in existing core objects, if any, were written by the core app designers and not generated by the framework.
           
          Loading
          Salesforce Help | Article