Unable to add Apex class to project using "Retrieve Metadata"

Issue #1430 resolved
Alan Birchenough created an issue

OK, so this could really easily be user error, since I always find the behavior surrounding retrieve to be difficult to understand.

  1. I have a project with a traditional connection to a sandbox. Everything seems to be working normally.
  2. There is a class present in the sandbox that is not in my workspace.
  3. I have successfully used “Configure Module” to add that class to my subscription. There is a big fat check mark next to it.
  4. I have tried running “Retrieve”, but no selection I make allows me to retrieve the missing class:

    1. Contents = “Context” with the src directory selected, and the “Server Only” filter, shows no Apex classes;

      1. This puzzled me because I thought “Context” meant essentially, whatever component is currently selected, e.g., in the Project tool window; in which case I wonder why it isn’t called “Current Selection” instead of “Context”;
    2. Contents = “Module ‘<Module name>’” with the “Server Only” filter shows no Apex classes;

    3. Both of the above continue to show no Apex classes even if the “Subscribed Only” filter is not set.

Can you please advise me on what I am doing wrong, or, in the case where my workspace state might have somehow gotten hinky, how I can reset it?

Thanks.

Comments (6)

  1. Scott Wells repo owner

    Alan, what you describe should work. Have you tried clicking the Refresh toolbar button in the retrieve dialog? It should refresh automatically when your metadata subscription is updated, but just in case can you see if that helps?

  2. Alan Birchenough reporter

    D’oh. Yes, that did resolve it. I must have updated the module config and refreshed from here in the wrong order or something. Apologies. There does seem to be quite a checklist of things to think about when trying to get new metadata into a project, and sometimes I do something in the wrong order. Thanks.

  3. Alan Birchenough reporter

    BTW, am I right in thinking that “Context” kinda means “whatever is currently selected”, or is it more/less/different than that?

  4. Scott Wells repo owner

    Context does mean what's currently selected, but if you select a folder it should show server-only metadata that would land in that folder.

    This whole metadata manipulation topic is being documented for the user guide right now. I'm reviewing the chapter on metadata subscription management now, and once that's published the tech writer will be working on metadata deployment/retrieval/delete. I'm also actively working on some feature enhancements in that area both to fill gaps and to simplify the common use cases.

  5. Log in to comment