Allow retrieval of metadata from installed managed packages

Issue #260 resolved
Scott Wells repo owner created an issue

Right now it's not possible to add metadata contents of installed managed packaged to the metadata subscription. This precludes use cases such as custom fields added to packaged objects. It should be possible to retrieve at least a subset of metadata from installed managed packages for local management.

Comments (12)

  1. Matt Addy Account Deactivated

    Scott, does IC ignore retrieval of objects in a managed package if I explicitly declare them inside my package.xml? For example,

    ...
    <types>
            <members>*</members>
            <members>ns__ManagedCustomObject__c</members>
            <name>CustomObject</name>
    </types>
    ...
    
  2. Scott Wells reporter

    I haven't tried it with a package.xml subscription yet, Matt, but my guess is that it does since that's the case with the other subscription types. I'm checking metadata object status as I enumerate candidates and am omitting INSTALLED. Softening of that should really be all that's required to get this working properly in conjunction with the changes I'm making right now to allow easier deployment/retrieval of metadata sub-types, e.g., CustomField/ListView/ValidationRule.

  3. Matt Addy Account Deactivated

    Scott, how does this work? It doesn't seem that when I do "Retrieve Metadata" that managed objects are coming through. In addition to that, when I explicitly declare them in a package.xml and specify that in the module settings, they aren't coming down either. Any thoughts?

  4. Scott Wells reporter

    Matt, first make sure that the local customizations to packaged custom objects are selected in your subscription. This may be in package.xml or it may be an explicit selection. For example, I added a local custom field to a packaged custom object, then went into the subscription editor and selected it under the CustomField metadata type. Then in the retrieve dialog, I selected Custom scope and then checked the custom field under objects > CustomField. I performed the retrieve and ended up with the .object file with the local custom fields.

    Please let me know if that doesn't give you what you need.

  5. Scott Wells reporter

    As you likely inferred from my response above, you can't retrieve the packaged aspects of installed custom objects, only your customizations to those objects.

  6. Matt Addy Account Deactivated

    Thanks Scott. That works. I wasn't looking for a CustomField metadata type, since they come down through the associated .object file.

  7. Scott Wells reporter

    Glad to hear. Yeah, there are root metadata types and child metadata types. The CustomObject metadata type in particular has a number of child metadata types that are transferred through the parent .object file but can be selected explicitly as well in the absence of the owning parent. It can be a bit confusing! And then there are metadata types like Profile which don't have a parent/child relationship with other types but are populated based on what other metadata types/members are selected during a retrieval, e.g., if you want the profile authorization for custom fields, you have to retrieve those fields in the same operation. Fun, fun!

  8. Matt Addy Account Deactivated

    Thanks for the info Scott. For clarification, why can't we retrieve the packaged aspects of installed custom objects? If I have a package.xml that looks something like this:

    <types>
            <members>ns__ManagedCustomObject__c</members>
            <name>CustomObject</name>
    </types>
    

    And a build.xml that contains a retrieve target that specifies unpackaged="package.xml", I get an object file that contains all information about the custom object (including packaged fields, etc).

    This question is more for clarification then anything else. The functionality you've provided works great for me.

  9. Scott Wells reporter

    Matt, there's no technical reason that you can't retrieve. However, if you were to retrieve it, it wouldn't make sense to save it with the packaged metadata elements because they're immutable and the save would fail. As a result, I'm not allowing you to pull down things into your local source tree that you can't deploy.

  10. Log in to comment