You are here:
Naming Conventions
Asynchronous methods and constants for business objects follow specific naming conventions.
Required Editions
| Available in: Lightning Experience in Performance, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled. |
Asynchronous Method Naming Convention
Add the async suffix to all asynchronous methods so that developers know what kind of returned object to expect from the method. For example, loadAsync, saveAsync, and createAsync.
Object Constants Naming Convention
The generator provides constants for business objects that you can use in your JavaScript business logic code. The table lists the formats for the constants.
| Object Type | Naming Convention for Constant |
|---|---|
| Business Object | BO_<business_object_name> |
| Lookup | LU_<lookup_name> |
| List Object | LO_<list_object_name> This name also works for the new objects provided by the generator. |
| List Item | LI_<list_item_name> |
The advantage of using these constants is that if you enter a typo for a constant, then you get an undefined variable error. If you enter a typo for the name of a business object, you don’t get a specific error message.
Sample Code for BoCustomer.loadAsync
var promise = Facade.getObjectAsync(BO_CUSTOMER, jsonQuery).then(
function (selfJson) {
if (Utils.isDefined(selfJson)) {
me.setProperties(selfJson);
var jsonParams = me.prepareLookupsLoadParams(selfJson);
return Facade.loadLookupsAsync(jsonParams);
}
}).then( function (lookups) {
if (Utils.isDefined(lookups)) {
me.assignLookups(lookups);
}
return BoFactory.loadObjectByParamsAsync(BO_BPAMETA, me.getQueryBy("pKey", me.getBpaMetaPKey()));
}).then( function (boBpaMeta) {
me.setBoBpaMeta(boBpaMeta);
return BoFactory.loadListAsync(LO_BPAADDRESS, me.getQueryBy("referencePKey", me.getPKey()));
}).then( function (loBpaAddressJson) {
me.setLoCustomerAddress(loBpaAddressJson);
me.getLoCustomerAddress().orderBy({"city":"ASC"},{"street":"ASC"});
