-
Notifications
You must be signed in to change notification settings - Fork 976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createService() Error #78
Comments
Hi there, I'm also using MetadataService for the first time (in a sandbox). I found definitions for createService and handleSaveResults in the examples class MetadataServiceExamples, so you can either copy them from there, or point to them if you've defined that class. But now I get a timeout error from the WebServiceCallout.invoke method that is called whenever MetadataService computes results. Could you let me know if you've gotten past that? Thanks,
|
Never mind. I now see how to increase timeout_x from the createService method. For details, see #77. |
@chris760 When running code in annonymous mode, you need to full qualify the static methods you call by the class those methods belong in, in this case createService and handleXXXX methods reside in MetadataServiceExamples.cls. However the handleXXXX methods where private, so i've now updated them to public, so download a deploy a new MetadataServiceExamples class then the following will work...
|
Hi Can some one help me test class for the MetadataServiceExamples . |
Hi, Can any one help in writing the test class fro MetadataServiceExample class, I wrote but not getting full code coverage. A sample test class will help me out. Thanks in advance. |
@vivekgithub6 test class is included in the repo here. 👍 |
Hi, |
Hi Andrew,
I just found your MetadataServices class today (the one here https://github.com/financialforcedev/apex-mdapi/blob/master/apex-mdapi/src/classes/MetadataService.cls). I copied the class, test class, and examples class in to my salesforce developer org (along with all the other classes just to be on the safe side) and created a remote site setting for https://na16.salesforce.com (the URL of my dev org). When I try to run any of your examples however (like the customObject example), I get the following error, “Method does not exist or incorrect signature: createService()”.
What's weird is that I can't find the actual "createService()" method in the current MetadataServices class that you have posted on here (unless I'm totally missing something), so I think that might be what's causing the problem.
The code that I'm currently trying to execute in the salesforce developer console ExecuteAnonymous window is the following:
MetadataService.MetadataPort service = createService();
MetadataService.CustomObject customObject = new MetadataService.CustomObject();
customObject.fullName = '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';
List<MetadataService.SaveResult> results = service.createMetadata( new MetadataService.Metadata[] { customObject }); handleSaveResults(results[0]);
Any ideas/suggestions would be much appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: