javascriptdynamics-crmcrmxrm

GetEntityMetadata returns 0 attributes


I need to get all the fields for a specific entity. I am currently using Xrm.Utility.getEntityMetadata("entity_name").then(success, failure); but on success the data returned has no attributes. Got any idea why?


Solution

  • You have to pass a string array of attributes list as second parameter to get them.

    Xrm.Utility.getEntityMetadata("account", ["accountname", "createdon"]).then(success);
    

    enter image description here

    Read more