New Metadata like Fields and Record Types not found with SFDX

Issue #1739 resolved
Jason Curry created an issue

I want to retrieve a new field or record type that I created in the Org. The object was already loaded in the project.

  1. I right-click on the object or objects node in the Project window,
  2. Select IC->Retrieve Metadata.
  3. Change the Contents to ‘Custom’
  4. Only ‘Server Only’ checked. (I have also tried with both ‘Server Only’ and ‘Local+Server’.)
  5. Refresh/update the metadata list.

I expect to find the new field or record type under the object, but they aren’t listed.

My workaround right now is to either manually create the file to the best of my ability, or start an entirely new project to load the metadata file and copy it over to my project.

Comments (19)

  1. Scott Wells repo owner

    Jason, is this retrieval of a metadata type that's new with API v50.0. If so, the issue is likely that I haven't yet shipped a build that uses the v50.0 SOAP APIs as I was waiting on the WSDLs from Salesforce. I've since received them and will be uploading a new build shortly (as in within a few hours) that speaks directly to API v50.0.

    Since you said fields and record types, though, my guess is that's not the issue. If that's the case, can you please add the following to Help>Diagnostic Tools>Debug Log Settings and then refresh the metadata list in the retrieval dialog:

    #com.illuminatedcloud.intellij.configCache.FilePropertiesCache
    

    Then please provide the resulting idea.log either here as an attachment or via email to support@illuminatedcloud.com. You can find it using Help>Show Log in Explorer/Finder/Files. Also please specify the exact type/name of the metadata that's not showing up properly so I can see how/whether it was returned by the API.

  2. Jason Curry reporter

    It has been happening since at least version 48. Was hoping it would be fixed by 50.

    I’m looking for a record type called Default_Project on the Status_Note__c object. One bit of info, Record Types were not previously enabled on the Status_Note__c object prior to this retrieve attempt.

    Attaching the log….

  3. Scott Wells repo owner

    Thanks, Jason. Because of the verbosity of this logging, I'm probably going to need all idea.log* files from the span of time of the issue reproduction. The one that was attached is only the last small portion of it. Do you mind providing those as well? I'm fine taking all idea.log* files and sorting through it myself if that's more convenient for you.

  4. Jason Curry reporter

    I don’t know if it means anything, but for this object, the .object file (Status_Notes__c.object) is just:

    <?xml version="1.0" encoding="UTF-8"?>
    <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
        <enableEnhancedLookup>true</enableEnhancedLookup>
    </CustomObject>
    

    Other object files are far more detailed.

  5. Scott Wells repo owner

    Thanks, Jason. So I do see that being returned by the server:

    2020-10-21 10:56:19,233 [  37948]  DEBUG - onfigCache.FilePropertiesCache - Evaluating for inclusion:
    {
      "createdById": "00570000003W0VHAA0",
      "createdByName": "Jason Curry",
      "createdDate": {
        "orig_year": 2020,
        "orig_month": 7,
        "orig_day": 2,
        "orig_hour": 4,
        "orig_minute": 2,
        "orig_second": 42,
        "orig_fracSeconds": 0.000,
        "orig_timezone": 0,
        "year": 2020,
        "month": 7,
        "day": 2,
        "timezone": 0,
        "hour": 4,
        "minute": 2,
        "second": 42,
        "fractionalSecond": 0.000
      },
      "fileName": "objects/Status_Note__c.object",
      "fullName": "Status_Note__c.Default_Project",
      "id": "0121F000001zv5FQAQ",
      "lastModifiedById": "00570000003W0VHAA0",
      "lastModifiedByName": "Jason Curry",
      "lastModifiedDate": {
        "orig_year": 2020,
        "orig_month": 10,
        "orig_day": 21,
        "orig_hour": 14,
        "orig_minute": 17,
        "orig_second": 6,
        "orig_fracSeconds": 0.000,
        "orig_timezone": 0,
        "year": 2020,
        "month": 10,
        "day": 21,
        "timezone": 0,
        "hour": 14,
        "minute": 17,
        "second": 6,
        "fractionalSecond": 0.000
      },
      "manageableState": "UNMANAGED",
      "type": "RecordType"
    } 
    2020-10-21 10:56:19,233 [  37948]  DEBUG - onfigCache.FilePropertiesCache - Including Status_Note__c.Default_Project. 
    

    Just so I'm 100% clear on the behavior that you're seeing, you don't see that record type in the subscription editor under the RecordType metadata type, e.g.:

    Record_Type_Subscription.png

    nor do you see it in the retrieval dialog (configured as follows) under objects>Status_Note__c>RecordType>Default_Project, e.g.:

    Record_Type_Retrieval.png

    Is that correct? If so, I'll need to see what other type of debug logging to get from you since we know it's being returned by the API.

  6. Scott Wells repo owner

    Jason, the first image I showed was in a different place. It's in the subscription editor which can be found in Illuminated Cloud>Configure Module. Do you see it listed there under the top-level RecordType metadata type folder?

  7. Scott Wells repo owner

    Ah, okay...good. That helps to isolate the location of the particular issue. We now know that it's properly enumerated via the API, and it's properly included in the subscription editor. It seems to be an issue with the build options dialog used for retrieval/deployment/removal. Since it's part of your subscription, does it appear if you check Subscribed Only under objects>Status_Note__c>RecordType>Default_Project? If not, I'll need you to get some debug logging for the construction of the tree in that dialog.

  8. Scott Wells repo owner

    Yeah, and that makes sense given that you're subscribed explicitly to the parent object. Sorry I missed that (much) earlier! Thanks for going through the diagnostic process with me...

  9. Log in to comment