Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to match entity's attributes and antityMetadata attributes? Some names mismatched

Posted on by 165

Hello.

I have entity Contact ( name = contact, type = Entity) in variable "entityObj".

I have array of attributes from Contact's metadata (based on type: AttributeMetadata)  named "AttrArray"

I want to set values from entity Contact's attributes ( = fields) to AttrArray.

Something like that:

AttrArray.ForEach( atribute =>
{
     var entityField=entityObj.Where ( g=>g.name = atribute.name );
     atribute .value = entityField.value;
});


It works, BUT !!!

Some fields (in entity Attributes and metadata  attributes) have MISMATCHED names! It's a problem.

Is there is a way to match that fields?

Mayby I have use othe objects ?

Thank you!

Exmaple:

Entity Contact: attribute "lastname"

MetadataAttribue:  attribute  "address1_name" (example)

*This post is locked for comments

  • Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: How to match entity's attributes and antityMetadata attributes? Some names mismatched

    Hi

    Is there any particular reason as to why you are using AttributeMetadata in your solution.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans