locked
Getting a field name through reflection RRS feed

  • Question

  • I am trying to get a list of all fields, their data type, their property name whether they are required or recommended and their display name for an entity. Most of this I can get through reflection but not apparently the display name or whether it is a required field.

    The scenario is that I have a custom import utility written in sliverlight which allows a user to import a CSV file and map columns in the CSV to columns in an entity or user defined columns. For my own data this is easy enough, I know in that case which fields are required but if a user has added another solution which includes a required field I need to include that in the import or the import will fail. So for example on importing a product reflection will tell me that I have a field called "name" but not that it's display name is "Product name", if I add a field "solution_category" I know that its display name is "Product category" but I can't get that from reflection. If a user adds another field "solution2_HazChemStat" with a display name of "Hazardous chemical status" and makes that a required field, reflection will tell me that the field "solution2_HazChemStat" exists but not its display name or that it is a required field.

    So how do I find the display name and whether a field is required?

    Friday, April 10, 2015 9:54 AM

All replies