You need to sign in to do that
Don't have an account?
Shabbir Shaik
Creating objects through Metadata API
I am creating custom object from APEX but when i use this, getting problem
Initial expression is of incorrect type, expected: MetadataService.Metadata at line 39 column 50
can any body know this, Here is my code.
Initial expression is of incorrect type, expected: MetadataService.Metadata at line 39 column 50
can any body know this, Here is my code.
List<MetadataService.CustomObject> customObjectlst = new List<MetadataService.CustomObject>(); MetadataService.CustomObject customObject = new MetadataService.CustomObject(); //customObject.nameField = 'Test__c'; customObject.label = 'Test'; customObject.pluralLabel = 'Tests'; customObject.nameField = new MetadataService.CustomField(); customObject.nameField.type_x = 'Text'; customObject.nameField.label = 'Test Record'; customObject.deploymentStatus = 'Deployed'; customObject.sharingModel = 'ReadWrite'; customObjectlst.add(customObject); List<MetadataService.SaveResult> results = meta.createMetadata( new MetadataService.Metadata[] { customObjectlst }); handleSaveResults(results[0]);
i modified Metadataservice class its working for me...
Good job every one!
All Answers
How can i overcome this problem can anybody know this?
https://github.com/BhawaniSharma/apex-mdapi
can you please give clarity or example to extend the "MetadataService.CustomObject"
Actually my problem is assigning customobject to metadataservice.metadata,
MetadataService.MetadataWebSvc meta=new MetadataService.MetadataWebSvc();
MetadataService.AsyncResult[] results = meta.create(new List<MetadataService.Metadata> { customObject });
i modified Metadataservice class its working for me...
Good job every one!
Can you please explain what exactly you have modified in MetadataService class b/c i am facing the same problem but didn't get any solution.