Metaforce Tricks - bulk create/update fields on a salesforce object

Metaforce Tricks - bulk create/update fields on a salesforce object

·

2 min read

In salesforce, there are 2 standard ways to create custom fields on the object.

  1. Use the "new" button under custom fields section of an object
  2. Use "Schema Builder" to add fields/objects

Both two ways above are so slow and time-consuming sometimes, like adding a bunch of similar fields, updating validation rules, etc. Is there any quick way to do those?

If you're a developer or familiar with salesforce metadata api, you might choose package.xml which is powerful and can be used to update most of metadata types. But it's not that easy to prepare package.xml and files you need to update, isn't it?

For example, if you want to create fields via package.xml, you have to do following steps:

  1. Prepare package.xml which include all field names you're creating
  2. Prepare all object metadata file which includes all new fields
  3. Compress all those files into a zip file
  4. Deploy the zip file via workbench, ant, or other tools
  5. Those steps are so technical and easy to be blocked by various of reasons, like zip format, typos, etc.

In this case, I even prefer to going back to salesforce and create them manually one by one, no kidding! Fortunately, Metaforce can do all those technical stuff.

Metaforce simplifies all those steps and all you need to do are just clicks!

Build & Retrieve package.xml

image.png

  1. Build & Retrieve package.xml
  2. Choose metadata type items by using Package XML Builder
  3. Retrieve selected metadata items by a single click

Update Or Retrieve A Field

image.png

  1. Add new fields in object xml file and Save
  2. After retrieving an object, you can directly update/refresh field metadata.
  3. If you need to create new fields, you can just copy one of a field metadata and put it in object-meta.xml as below
  4. Update field metadata properties accordingly, like full name, label, field type, etc.
  5. Click Save and Done!

image.png

With this way, you can batch create/update fields, validation rules, field sets, button and links.

Learn more about Metaforce