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 The examples of saveAsync in existing core objects, if any, were written by the core app
designers and not generated by the framework.
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.