1

I am already aware of the Traditional method of creating Custom Objects and fields using object manager in Salesforce but just curious if there is another way to create them that will increase a developer's productivity in case of multiple object and field creation is required?

3

This approach is not "from the [Setup] UI"...

The SFDX format for projects - where the metadata is retrieved/deployed or pulled/pushed to an org - benefits from having individual files for each field. For example:

<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>StartDate__c</fullName>
    <externalId>false</externalId>
    <label>Start Date</label>
    <required>false</required>
    <trackTrending>false</trackTrending>
    <type>Date</type>
</CustomField>

This allows objects to be assembled by copying and pasting of field files and objects to be edited by search and replace. IDEs such as VSCode that work with SFDX are a big help too.

But there is a learning curve to using these tools, so they only makes sense if the work is going to go on for quite a few weeks.

  • 2
    Or when you want to preserve the object model and port it from org to org where the orgs are not related. – Phil W Dec 28 '19 at 13:40
  • Thanks, Keith for the solution. I think that is a good possible solution to create Object and fields using metadata. However, as you said, I think I would need knowledge of some of the tools to get this done by this approach. – Aditya Dec 29 '19 at 14:59
2

My favorite methods are Schema Builder and Cloud Toolkit.

Both of them are good for high volume. You can get to Schema Builder from setup. You can drag new fields or objects onto the schema.

Cloud Toolkit has Field Creator, which lets you create several fields at the same time, object by object. The objects do need to exist for Field Creator to work.

  • Thanks for the suggestion Allison. The schema builder is also a Setup UI option. I also found another option to create objects with fields and data using spreadsheets today in Lightning and that also works well but only with a few Data Type option. The section choice CloudToolkit is a new solution that I got to know just now. Really !! thanks for the that. However, I was looking at some programmatic approach(if any) in this case. – Aditya Dec 29 '19 at 14:55
  • @Aditya gotcha. Then the SFDX format is likely your best bet. I was just going for faster than Object Manager :-) – Allison Letts Dec 30 '19 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.