Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Unable to retrieve 'RecordType' metadata

I trying to retrieve the complete list of RecordTypes within my org. I am executing the following queries for the said purpose:

INSERT INTO MD_RecordTypeObj (Name,Member) Values ( 'RecordType', '*' )

Exec SF_Metadata 'Retrieve', 'SALESFORCE_HBDEV', 'MD_RecordTypeObj'

But I am not getting any XML extract in the 'MetadataXML' column.
1 person has
this problem
+1
Reply
  • Can you post the complete message output? Also what version of DBAmp are you running?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • I was able to get the output when the component was 'CustomObject' i.e. when the 'Name' column had 'CustomObject' as the value
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Below is the message when I executed "Exec SF_Metadata 'Retrieve', 'SALESFORCE_HBDEV', 'MD_RecordTypeObj'"

    --- Starting SF_Metadata for MD_RecordTypeObj
    06:24:42: Run the DBAmpNet.exe program.
    6:24:43: DBAmpNet V2.18.3 (c) Copyright 2014 forceAmp.com LLC
    6:24:46: Sending Retrieve package to https://cs42.salesforce.com/services/...
    6:24:51: Retrieve response received from salesforce.
    6:24:51: Ending DBAmpNet. Operation successful.
    --- Ending SF_Metadata. Operation successful.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Does the following query work:

    Select id from SALESFORCE_HBDEV...[User]
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • That version of DBAmp should not work with sandbox orgs because of the new salesforce tls requirement. Also, the version number in the output does not match with the version number you posted earlier.

    Let me open a case for this. Can you send an email to support@forceamp.com with your current serial number? You can find your serial number in the DBAmp Configuration Program. We can then setup a web meeting to take a closer look.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • You are right Bill, the versions differed as I was connecting from a different system and the actual version is 2.18.3

    I have sent the email with the serial number to the support team.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • With the new version of DBAmp, you can use the salesforce Tooling api and retrieve the RecordType information:

    Select * from salesforce...RecordType

    Let me know if this does not get the info you want.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Hi Bill - was there a resolution to this ? I am experiencing the same problem - MetadataXML column is NULL when attempting to retrieve/list Metadata Type RecordType information from one of our sandbox instances. Other Metadata Type retrieve/list Operations for CustomObject, Layout have been successful.

    Not an urgent need for resolution, but trying to utilize extract metadata information for development documentation.

    details below :

    INSERT INTO [SFDC_Integration_BulkOps_UAT].[dbo].[MD_RECORDTYPE_ALL_FSANDBOX]
    (Name, Member) VALUES ('RecordType','*')
    --

    EXEC SF_Metadata 'List', 'Salesforce_FSANDBOX', 'MD_RECORDTYPE_ALL_FSANDBOX'

    (1 row(s) affected)
    --- Starting SF_Metadata for MD_RECORDTYPE_ALL_FSANDBOX V3.6.7
    11:07:07: Run the DBAmpNet2.exe program.
    11:07:07: DBAmpNet2 3.6.7.0 (c) Copyright 2015-2017 forceAmp.com LLC
    11:07:08: Connection to SQL successful.
    11:07:09: Performing LIST for RecordType - *
    11:07:10: DBAmpNet2 Operation successful.
    --- Ending SF_Metadata. Operation successful.

    --Sample Results in Image Upload below, MetadataXML column = NULL for All rows in table

    SELECT * FROM MD_RECORDTYPE_ALL_FSANDBOX
    WHERE [Member] LIKE 'Account%'

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • You're missing the last step. The 'List" operation just expands the *.

    You then need to do a 'Retrieve' to retrieve the metadata for the individual rows:

    EXEC SF_Metadata 'Retrieve', 'Salesforce_FSANDBOX', 'MD_RECORDTYPE_ALL_FSANDBOX'
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Hi Bill – Sorry, I should have copied the Retrieve execution details. I ran through a retrieve for one of the rows listed (Account.Customer) And using the ‘*’ wildcard and the MetadataXML column is NULL as well.
    I did just notice that the ID column is also NULL in the Retrieve output tables. The Salesforce_FSANDBOX Linked server connects using my Salesforce login & I am in the System Administrator profile. I can view and make changes to the page layout Account.Customer page layout using the Salesforce interface, But trying to open the page layout using the ID shown in the LIST run (0124D0000000BXYQA2) throws an insufficient privileges error. Is there maybe some additional privilege required for extracting RecordType metadata ?

    Test run Retrieve details below :

    TRUNCATE TABLE [SFDC_Integration_BulkOps_UAT].[dbo].[MD_RECORDTYPE_ALL_FSANDBOX]
    --
    INSERT INTO [SFDC_Integration_BulkOps_UAT].[dbo].[MD_RECORDTYPE_ALL_FSANDBOX]
    (Name, Member) VALUES ('RecordType','Account.Customer')
    --
    EXEC SF_Metadata 'Retrieve', 'Salesforce_FSANDBOX', 'MD_RECORDTYPE_ALL_FSANDBOX'

    (1 row(s) affected)
    --- Starting SF_Metadata for MD_RECORDTYPE_ALL_FSANDBOX V3.6.7
    15:21:58: Run the DBAmpNet2.exe program.
    15:21:58: DBAmpNet2 3.6.7.0 (c) Copyright 2015-2017 forceAmp.com LLC
    15:22:00: Sending Retrieve package to https://sdmc-sandbox--fsandbox.my.sal...
    15:22:01: Retrieve response received from salesforce.
    15:22:02: DBAmpNet2 Operation successful.
    --- Ending SF_Metadata. Operation successful.

    --Sample Results in Image Upload below, MetadataXML column = NULL on Retrieve as well

    SELECT * FROM MD_RECORDTYPE_ALL_FSANDBOX



    TRUNCATE TABLE [SFDC_Integration_BulkOps_UAT].[dbo].[MD_RECORDTYPE_ALL_FSANDBOX]
    --
    INSERT INTO [SFDC_Integration_BulkOps_UAT].[dbo].[MD_RECORDTYPE_ALL_FSANDBOX]
    (Name, Member) VALUES ('RecordType','*')
    --
    EXEC SF_Metadata 'Retrieve', 'Salesforce_FSANDBOX', 'MD_RECORDTYPE_ALL_FSANDBOX'

    (1 row(s) affected)
    --- Starting SF_Metadata for MD_RECORDTYPE_ALL_FSANDBOX V3.6.7
    15:32:49: Run the DBAmpNet2.exe program.
    15:32:49: DBAmpNet2 3.6.7.0 (c) Copyright 2015-2017 forceAmp.com LLC
    15:32:51: Sending Retrieve package to https://sdmc-sandbox--fsandbox.my.sal...
    15:33:07: Retrieve response received from salesforce.
    15:33:08: DBAmpNet2 Operation successful.
    --- Ending SF_Metadata. Operation successful.

    --Sample Results in Image Upload below, MetadataXML column = NULL on Retrieve as well

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • You have to run the list to expand the * followed by the retrieve on the output of the list. Here is what works for me:

    CREATE TABLE MD_RecordType (
    [Name] [nvarchar](255) NULL,
    [Member] [nvarchar](255) NULL,
    [MetadataXML] [xml] NULL,
    [CreatedByWildcard] [bit] NULL,
    [CreatedByList] [bit] NULL,
    [Error] [nvarchar](255) NULL,
    [Id] [nchar](18) NULL
    )
    INSERT INTO MD_RecordType
    (Name, Member) VALUES ('RecordType','*')
    --

    EXEC SF_Metadata 'List', 'salesforce', 'MD_RecordType'

    EXEC SF_Metadata 'Retrieve', 'salesforce', 'MD_RecordType'
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Hi Bill – Thanks for your continued input. I was in essence performing the LIST function first & then running the RETRIEVE, but I did exactly replicate your code sequence just to be sure. It may just be misunderstanding of what Metadata is available for the RECORDTYPE. In examining all rows in the resulting MD_RecordType table after the RETRIEVE here’s what I found relating to the Account Object ( as an example )...



    There are 2 Record Types set up in this sandbox instance for sObject = Account ( 1. Name : Customer, 2. Name : Vendor )

    I was expecting to see MetadataXML info showing in the RecordType “specific” Member rows (Account.Customer, Account.Vendor). Nothing comes across after running the RETRIEVE for those LIST row IDs.

    The MetadataXML info that does get extracted in the Member row (Account) details the RecordType Picklist value assignments. So I can at least make use of that information for documenting pick lists now that I know how the recordtype extract output is structured.

    Thanks again,
    Sharon
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly