How to avoid errors due to objects with the same name?
← Setup and Service FAQ ← Salesforce Environment FAQ
JustOn regularly delivers updates to bring new features, improvements and fixes to JustOn Billing & Invoice Management. Updates may also add objects to the package.
In Salesforce, objects with the same name can typically coexist without issues. However, conflicts may arise when a custom object is set up as the source for automatic subscription building, usage data billing, or the generic invoice run, for example Job__c
. In case a new version of JustOn Billing & Invoice Management introduces an object with the same name ( ONB2__Job__c
), the business logic built on top of the custom object may fail. It may try to use the new object from the package, and then, failing, report missing fields or unexpected values, like
Filter Jobs: The following fields are required for Object ONB2__Job__c: ON_Account__c, ON_Invoice__c, ON_Template__c, ON_LastInvoiceRun__c, ON_ServiceDate__c, ON_InvoiceBuildError__c.
But Job__c
and ONB2__Job__c
are not identical?
Although the API names of the two objects are not identical, they are the same to Salesforce. Salesforce does not consider namespace prefixes like ONB2__
when calling objects. So the packaged JustOn object ONB2__Job__c
is taken as Job__c
, which causes the conflict.
JustOn recommends two approaches to avoid these errors:
- Modify the API name of the custom object
-
Do this because once the object from a package is released, neither the package developer nor the subscriber can edit the object name and the record name data type.
This approach requires to modify all related business logic accordingly.
- Clone the custom object providing a new name
-
Creating a clone of the custom object providing a new name (
Job__c
→UsageJob__c
) allows to "retarget" the business logic.With a lookup or master-detail relation between the custom object and its copy, you can create formula fields that mirror the original fields that are required for the business logic. Then, just point the business logic to the clone, and have a flow create the actual record copies.
This way, you can keep all data in the custom object, but JustOn Billing & Invoice Management will operate on the copy.
Info
If you need assistance, contact JustOn Support.