SQL query to get the list of field labels within a section on a form (on-premise) RRS feed

  • Question

  • Hi all,

    I need a SQL query which returns the display labels for the fields on the form for a entity.

    E.g I created a new attribute 'Employer2' with Attribute/field display name as 'Employer2' on an account entity. However when i add it to the form, I changed the Label [field properties] for this field to 'Second Employer'. 

    Another example could be for the owner field. I changed the label for this Owner field as 'Primary Owner' on a account form.

    As a result of SQL query, I would like to see the display label on the form and the schema name for the field as shown below.

    Second Employer           new_Employer2

    Primary Owner               ownerid

    I have a query which return the field display name and schema name but I needed the form display name which could be different than the field display name.

    Thursday, July 14, 2016 7:46 PM

All replies

  • This information is within the FormXml for any form. To get the data, you'd need a SQL query to get the FormXml from the SystemForm entity, then you'd need to parse the xml - you could probably do this with the xml capabilities within SQL. You're ultimately looking for:

    • A <cell> element that will contain a <control> element with the datafieldname attribute
    • One or more <label> elements (one per language) with the description attribute

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Friday, July 15, 2016 12:47 PM