Retrieve metadata / compare with server doesn't work

Issue #2158 resolved
Sebastiaan Simons created an issue

For a lot of metadata, I can’t compare with the server or retrieve it.

Attached the log.idea for a Compare with Server action.

Example message:

Successes

• package.xml

Failures

• package.xml: Entity of type 'RecordType' named 'B2B_Quote_Request' cannot be found

Thanks in advance.

Comments (10)

  1. Scott Wells repo owner

    Hi. Thanks for the log. I see a few issues in the log. First, your project's source root may be configured too high. It looks like it's set as the project root when it should likely be either force-app or force-app/main/default. Second, while this project appears to be for a source format project, it's configured to use a native connection which cannot be used with source format. You must use an OAuth connection to the same organization. You can do so by registering the Salesforce CLI with IC2, creating an OAuth connection to the same org, and switching to that connection.

    Please make those changes and let me know if the retrieval doesn't work properly.

  2. Sebastiaan Simons reporter

    Thank you for checking.
    Changing the source root didn’t do anything but changing the connection to use OAuth worked.
    The recordType issue from my original post still persists though, in that it doesn’t retrieve the changes I made through the UI. (picklist values).
    Do you maybe know anything about that? But otherwise the issue is resolved. Thanks again!

  3. Scott Wells repo owner

    I'm glad that resolved most of the issues. I'm not aware of any issues with record type retrieval and just did a retrieve-for-merge against a single record type metadata file in one of my projects successfully. Can you please provide a new debug log of the failed record type retrieval with everything else fixed? It should use the Salesforce CLI to retrieve it now that you're using an OAuth connection against a source format project.

  4. Sebastiaan Simons reporter
      <div class="preview-container wiki-content"><!-- loaded via ajax --></div>
      <div class="mask"></div>
    </div>
    

    </div> </form>

  5. Sebastiaan Simons reporter

    I can see that the standard picklists are there (and they are correctly updated when I retrieve the file), but the custom picklists are hidden behind this grey arrow thing:

    If I click on it, I can see all the custom picklists, but they are not updated when retrieved:

  6. Scott Wells repo owner

    Hi. Those gray arrows are the IDE's way of showing changes relative to the current committed version in the version control system. That shows that something was removed in the retrieval. If you click on it, it'll show the actual changes as a relative preview. You can read more about how the JetBrains IDEs integrated version control information here:

    https://www.jetbrains.com/help/idea/version-control-integration.html

    Also note that you can have much more fine-grained control over this by using Retrieve for Merge:

    https://bitbucket.org/RoseSilverSoftware/illuminatedcloud/wiki/User_Guide/Retrieving_Metadata.md#markdown-header-comparing-with-server

  7. Sebastiaan Simons reporter

    It’s strange. It’s only showing changes if I also retrieve the custom picklist field in the same retrieval.
    But it’s still ‘deleting’ all the other custom picklists after I retrieve it (except for the picklist fields I retrieve it together with).
    I don’t really understand this behaviour. Is it a SF CLI thing?

    Because then, the only solution I found, is to copy the changes, rollback to the file which contains all metadata again (with all the custom picklist fields), and paste the changes there.

  8. Scott Wells repo owner

    There are other metadata types that behave in a similar manner. For example, with profiles and permission sets, if you don't retrieve the Apex classes, Visualforce pages, custom objects/fields, etc., that they authorize, they come back sparsely-populated. I haven't ever noticed that specific behavior with picklist metadata but I'm honestly not surprised to hear about something else behaving this way. If so, just as with profiles and permission sets, you'll need to do a more full metadata retrieval to get fully-populated documents.

    As for the copy/rollback/paste workaround, again I encourage you to use Retrieve for Merge which is explicitly designed to help with piecewise merging of retrieved Salesforce metadata into local files.

  9. Sebastiaan Simons reporter

    Ok thank you, all clear now.
    Retrieve for merge does help making it a smoother process yes 🙂

  10. Log in to comment