Closed avinashega closed 9 years ago
Yep. that didn't really help. I'm assuming it's an issue at salesforce's end.
If you login via Developer Workbench and review the fullName via the Metadata listing UI in that tool, what does it show?
In my case I'm getting 'geneapplicationsc-portal'. where gene is the namespace of the package and applications__c is the custom object from the package and 'portal' is a layout that I have created on the object in my org.
I can see it in the listmetadata response as well. but when I try to retrieve it, I get a blank response.
I'm starting to wonder if this is a bug in the Metadata API.... :-1:
My suggestion would then be to copy paste the SOAP request and use it as repo steps in case.
(avoiding Salesforce support getting distracted with the Apex wrapper).
Please do let me know how you get on if you take this route, really sorry i've run out of ideas on this one.
I've opened a case for this issue - being unable to retrieve unmanaged layouts on managed objects using readMetadata(). It does work if I use retrieve() instead, but that requires a visualforce page or external service to handle the zip files.
Thanks @jeffhube for the update, any news?
Having the same problem where readmetadata couldn't read a page layout that I created inside a installed package. For example: readmetadata is able to do this--> readMetadata("Layout", new string[] { "SFCustom_Objectc-SFLayoutName" }); for installed layout, but I can't do this--> readMetadata("Layout", new string[] { "SF__Custom_Objectc-America" }) I'd tried debugging and tried using 2 namespaces but it's not working. Let me know if you can use readmetadata to read layout created inside layout package.
Have a look at my FAQ blog post (linked on the README) i have some tips in that i believe.
Hi Andrew, Thanks for you efficient reply.
So in the README markdown you used new String[] { sFolderApiName+'/'+sReportApiName } I had tried using the apifolder name like--> new string[] {"layouts/SFCustom_ObjectC-America"} and also tried double namespace --> new string[] {"layouts/SFCustom_ObjectC-SF__Ameria"} and it still didn't work.
My only solution to this problem right now is to retrieve that specific layout XML file, deserialize XML file to type "Layout" and cast it to Metadata.Layout.
e.g: MetadataService.Layout Layout = (MetadataService.Layout)DeserializeXMLFileToObject
Note: I am using C# to program this.
Ah i see, @Sheing, your using .net, i had not appreciated that. I think the underlying issue with managed layouts and the Metadata API plagues us regardless of .net or apex tbh. I'm glad you've got it moving, i assume via the 'retrieve' API?
@afawcett Yeap I am using the retrieve Metadata API to get the specific layout created inside the installed package. As of now, it works fine but it will be something hard to maintain in the future considering I have to retrieve that particular layout to do something in my web app. Anyway, thanks for the reply, I appreciate that.
No problem. Meanwhile try the Apex Native MD API, see if that works for you?
Hi,
I have created a new layout for a custom object that is from an installed package. In this case, the fullName of the layout will be : NamespaceCustom_Object_namec-Layout_Name
I tried the below code but it returns a blank response.
The request that goes out:
The response:
But, when I call listMetadata(), I can see that layout in the response.