0

I am looking for a way to create custom field from Apex.

Use case: we are using a specific field (E.g.: Own_Id_Field__c, TEXT(255), ExternalID: TRUE).

User should be able to select which (Custom) Object they want to use in the app and this should create custom field (for good functioning).

I would like to do someting like:

public static Schema.DescribeFieldResult createOwnIdField(String sObject) {
  // Test if sObject exists
  // Create field
  return field;
}

I heard about using Metadata API but did not really understood.

Simonp
  • 1,892
  • 4
  • 23
  • 50

0 Answers0