Is there any trick to retrieving action overrides via the metadata api?
The docs seem to indicate this is straightforward, just use object dot notation and a type of ActionOverride. But when I use the package.xml below I’m getting an
Entity type: 'ActionOverride' is unknown error. Any idea what I’m doing wrong? It seems people are equally stumped on the salesforce dev boards. I’ve also tried
actionoverride since in the past the docs have misspelled the retrieve targets, but no luck.
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>CuystomObject__c.Edit</members> <name>ActionOverride</name> </types> <version>28.0</version> </Package>
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Metadata API states: “You can only access ActionOverride by accessing its encompassing CustomObject.”
This is in the docs for the API.
Check out the code example there and you’ll see it looks a lot like yours, only wrapped in CustomObject, not Package.
I maintain two repositories; one for the specific things we need from standard objects (like listviews, recordtypes, customfields) and another repo where we grab the entire object but remove the tags we don’t want with the script below (I run it on OSX but it works just as well on git-bash).
#!/bin/bash for file in src/objects/*.object; do echo fixing "$file" ex -s +'g/<businessProcesses>/,/</businessProcesses>/d' +'g/<compactLayouts>/,/</compactLayouts>/d' +'g/<fieldSets>/,/</fieldSets>/d' +'g/<listViews>/,/</listViews>/d' +'g/<recordTypes>/,/</recordTypes>/d' +'g/<validationRules>/,/</validationRules>/d' +'g/<webLinks>/,/</webLinks>/d' +'g/<fields>/,/</fields>/d' +'wq' "$file" done
We push the first one (specific) with our deploys, then deploy the second because it doesn’t require running unit tests.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0