web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Party List type, read and set to another party list

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

I am fetching multiple records using fetch XML

where I have party list type

Now I want to read and set that party list into another Entity Reference?

How to read party list record, with their properties (entity, text value and Guid)?

Finally how can I set up another new party list?

 

Thanks and Regards

Sushil Rai

sushil.crmrai@gmail.com

MSD CRM Consultant 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Waqar Sohail Profile Picture
    on at

    Hi Sushil,

    You can read Party List like this..

     if (entity.Attributes.Contains("partyListAttributeName"))
                        {
                            EntityCollection _partyList= ((EntityCollection)entity.Attributes["partyListAttributeName"]);
                            foreach (var c in _partyList.Entities)
                            {
                                if (c.Contains("partyid"))
                                {
                                    EntityReference refEntity = new EntityReference();
                                    refEntity = (EntityReference)c.Attributes["partyid"];
                                }
                            }
                        }


    You can set party List something like this.

     EntityReference FromAdd = new EntityReference("systemuser", Id);
     Entity fromActivity = new Entity("activityparty");
     fromActivity.Attributes["partyid"] = FromAdd;
     EntityCollection FromEntity = new EntityCollection();
     FromEntity.Entities.Add(fromActivity);
    
    // now assign the above created party list to new entity.
     email.Attributes["from"] = FromEntity;


    you can use these references as well.

    https://msdn.microsoft.com/en-us/library/hh372955.aspx

    https://social.msdn.microsoft.com/Forums/en-US/2d0a9237-dd66-44c7-b9f6-167aca121c22/how-to-retrieve-and-set-partylist-value-form-email-activity-using-plugin?forum=crm

  • Community Member Profile Picture
    on at

    Thank you buddy

    It really help me out to understand my concepts

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans