简体   繁体   中英

How to Retrieve filtered metadata of entity using javascript in Dynamics CRM

I want to fetch attributes of particular entity in javascript.But don't want all attributes which are of no use or can't be able to see in crm form or in form editor. I get all attribute using SDK.Metadata.But It gives all the attributes.

Code:

SDK.Metadata.RetrieveEntity(SDK.Metadata.EntityFilters.Attributes,
                "contact",
                null,
                false,
                function (entityMetadata) { successRetrieveEntity(module, entityMetadata); },
                errorRetrieveEntity);

So anyone please suggest me the way from which I get only the attributes which are in form or able to see in form editor.

You may be able to use the MetadataConditionExpression class to filter for attributes you are interested in. I'm not aware of a flag that represents "onForm", but you should be able to do some filtering.

https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.metadata.query.metadataconditionexpression(v=crm.6).aspx

It's also in the SDK under SampleCode\\CS\\Metadata\\MetadataQuery\\MetadataQuerySample.cs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM