More About Salesforce Custom Objects Behavior
Utilize the accompanying points to work out how the API communicates with custom items and fields:
- Naming Conventions for Custom Objects
- Relationships Among Custom Objects
- Audit Fields for Custom Objects
- Sharing and Custom Objects
- Tags and Custom Objects
- Standard Fields for Custom Objects
- Required Fields in Custom Objects
- Managed Packages and API Names
Review Fields for Custom Objects
Custom articles can have the same review fields as standard items. For the purpose, once you make a custom item, the four review fields, CreatedById, CreatedDate, LastModifiedById, and LastModifiedDate, are made and populated for the article. These fields are perused because they were. within the event that you just import information into Salesforce custom articles and wish to carry the review field esteems from the source framework, you'll set the qualities once you make the custom items. The most reviewed field you cannot set an incentive for is SystemModstamp. Your association must be API empowered, and you ought to have the "Adjust All Data" consent.
- From Setup, enter the interface within the Quick Find box, at that time select program under Customize.
- Under Setup, select Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners" User Permissions.
- within the consent set or profile that you just must set review fields with, empower the authorization Set Audit Fields upon Record Creation.
- Utilizing the API, make a record, and set its review fields.
Don't forget to check out: 5 Tips for Deploying Custom Objects in Salesforce to Production
Note these limitations:
- CreatedDate cannot be more noteworthy than the LastModifiedDate.
- You cannot set any date field to be more prominent than this time.
Sharing and Custom Objects
A sharing standard item is created for each custom article that does not have an expert detail relationship to a different item. they're like standard item sharing principles, as an example AccountOwnerSharingRule. within the event that the client making the custom item has the "Oversee Sharing" consent, a sharing principle object is consequently made for it.
Zenith sharing reasons is recovered portraying the custom item's sharing article, and looking out at the info within the rowCause field. The name of a sharing item for each custom article is of the structure: MyObjectName__Share, like AccountShare and other standard article sharing articles.
Labels and Custom Objects
At the purpose when a custom article is created, a Tag object identified with it's likewise made. These item names are of the structure: MyObjectName__Tag, like AccountTag and other standard article label objects.
Standard Fields for Custom Objects
At the purpose when a custom article is formed, Salesforce appoints some standard fields to the item or element. For subtleties, see Custom Objects.
Required Fields in Custom Objects
In the UI, you'll be able to check a custom field PRN, and this standard is additionally implemented within the API. Every custom field has an isRequired field, with an information type boolean. The default esteem is bogus. Whenever set to valid, each solicitation supplies a worth (or leaves this worth) to the present field. Something else, the solicitation comes up short. At the purpose when the price is about to valid, whenever the sphere is altered or made, the approval applies. within the event that no worth is provided or default esteem indicated, the solicitation falls flat.
To alter the isRequired field, you must sign on as a client with the "Modify Application" consent.
On the off chance that you simply change a custom item field to be needed in a very current customer application or coordination, be sure that a worth is provided for that field. for example, if the custom picklist field Education Level on the contact object is required, flexibly a default an incentive for that custom field. within the event that a necessary field doesn't have a predefined or default esteem, a slip-up with the status code REQUIRED_FIELD_MISSING is returned.
Check out another amazing blog by Mohit here: Salesforce Custom Objects and Behavior - All You Need to Know
Overseen Packages and API Names
In the event that you simply have an unmanaged bundle and an oversaw bundle rendition parades, the API names of custom fields, custom items, and Scontrol objects within the bundle change. A namespace prefix is added to each part to form it remarkable: name__c becomes prefix__name__c. to maneuver from an unmanaged bundle to an oversaw bundle variant of an identical application, trade your information, uninstall the old bundle, and introduce the new bundle. At that time survey the name changes and import your information with significant planning.