Answers for "https://cloras.com/blog/creating-custom-object-and-custom-fields/"

0

https://cloras.com/blog/creating-custom-object-and-custom-fields/

MetadataService.MetadataPort metadataservice = new MetadataService.MetadataPort();
	metadataservice .SessionHeader = new MetadataService.SessionHeader_element();
	metadataservice .SessionHeader.sessionId = UserInfo.getSessionId();
	List  fields = new List ();
	MetadataService.CustomObject customobject = new MetadataService.CustomObject();
	customobject.fullName = 'custom_create__c';
	customobject.label = 'custom created object';
	customobject.pluralLabel = 'custom created objects';
	customObject.nameField = new MetadataService.CustomField();
	customobject.nameField.type_x = 'Text';
	customobject.nameField.label = 'status';
	customobject.deploymentStatus = 'Deployed';
	customObject.sharingModel = 'ReadWrite';
	fields.add(customobject);
	metadataservice.createMetadata(fields);
Posted by: Guest on June-08-2021

Code answers related to "https://cloras.com/blog/creating-custom-object-and-custom-fields/"

Browse Popular Code Answers by Language