function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vasavi VajinepalliVasavi Vajinepalli 

Creating dynamic objects in sfdc using apex

Hi,

Can you please suggest me that is there any way to create Custom objects dynamically in sfdc using apex? If so, can anyone please share a sample code which can create the custom objects, fields with lenghs, names and types.

thanks,
vasavi 
scottbcovertscottbcovert
Hi Vasavi,

Currently metadata cannot be updated from Apex (though it is in review by the product team-go here to vote for this idea! https://success.salesforce.com/ideaView?id=08730000000l4TkAAI )

That said, Andrew Fawcett of FinancialForce created an Apex wrapper around the metadata api as a workaround that is worth looking into: https://github.com/financialforcedev/apex-mdapi


Best,
Scott