-
Notifications
You must be signed in to change notification settings - Fork 974
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
How give Field accessable permission as Editable in pagelayouts Using metadata api? #41
Comments
Did you specify the correct Layout name? In my example I had a Custom Object called Test__c with a standard Layout. Unless you also have a Test__c object you will need to change this. |
There does look to be a bug in the readMetadata method when you don't give a valid metadata component name, such as the correct layout, it does not throw an exception. But instead returns an empty Layout, thus when you later call the updateMetadata method it rejects it because the fullName is empty. The solution to this in the meantime is to always make sure you pass a valid component name to the readMetadata method. |
Hi Andrew, Class.rajesh.MetadataService.MetadataPort.updateMetadata: line 8163, column 1 IN DEBUGLOG LAYOUT Location like below |
I still think 'Test__c-Test Layout' is wrong this is why your getting this problem. Can you use Developer Workbench to list the layouts and confirm the full name is 'Test__c-Test Layout'. Also are you developing in a packaging org with the namespace set? This can change the name of the layout. |
Hi Andrew fawcett,
|
So your in a namespace org by the looks of this? Your namespace is set to rajesh under the Create > Packages page, is this correct? If so, i think the full name needs to include the namespace, take a look at this issue #32. Especially this last comment...
Maybe you need to provide...
Or try...
|
Hi Andrew Fawcett, |
Welcome! 👍 |
Hi Andrew Fawcett,
I got following Error Related to addFieldToLayout() in your metadata api github related method.
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: null: Required field is missing: fullName faultcode=sf:UNKNOWN_EXCEPTION faultactor=
Error is in expression '{!createField}' in component apex:commandButton in page rajesh:createfields
Class.rajesh.MetadataService.MetadataPort.updateMetadata: line 8193, column 1
Class.rajesh.MetadataController11.addFieldToLayout: line 906, column 1
Class.rajesh.MetadataController11.createField: line 243, column 1
line 906:
handleSaveResults(
service.updateMetadata(
new MetadataService.Metadata[] { layout })[0]);
line 246:I called addFieldToLayout()
The text was updated successfully, but these errors were encountered: