Skip to content
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

Metadata retrieve #10

Open
nullglitch opened this issue Aug 15, 2018 · 2 comments
Open

Metadata retrieve #10

nullglitch opened this issue Aug 15, 2018 · 2 comments

Comments

@nullglitch
Copy link

What are the "options" when using the "retrieve" function in the metadata SfdcMetadataApi?

@nickmellor
Copy link

nickmellor commented Aug 17, 2018

Hey nullglitch,

This isn't documented as far as I can see, so I went to the source code and to the metadata API to find out more. It took a fair amount of effort.

'options' is a list of unpackaged metadata types to retrieve, and the members of that type you want to retrieve.

In my case I used the following code. The asterisks mean retrieve all members for this metatype.

metatypes = ['AccountSettings', 'ActionLinkGroupTemplate', 'ActionOverride']
retrieve_options = dict(single_package=False)
# include all members of each type, in order
unpackaged_types = OrderedDict()
for metatype in metatypes:
    unpackaged_types[metatype] = '*'
retrieve_options['single_package'] = False
retrieve_options['unpackaged'] = unpackaged_types
return retrieve_options

If you try to retrieve all metatypes at once you may hit Python's memory limit, as sfdclib tries to build the zip in memory. Depends how big your Salesforce solution is.

There are one or two metatypes that cause errors. I'm raising a separate ticket for those.

Cheers,

Nick

@adam133
Copy link

adam133 commented Jan 24, 2020

Adding to @nickmellor's comment, this page has the full list. https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants