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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Unable to retreive Organizer element in appointments

(0) ShareShare
ReportReport
Posted on by 230

Hi,

I'm trying to fetch a list of related appointments in VS C# so i can export them to our billing app. 

it works great except i can't retrieve the organizer element / attribute / (field) 

Here is the query.

i get this error: 

Code: -2147220970
Message: An unexpected error occurred.
Plugin Trace:Inner Fault: Has Inner Fault

if i comment out "organizer" then it work A1.

ActivityQry = new QueryExpression("appointment");
ActivityQry.ColumnSet = new ColumnSet("subject", "regardingobjectid", "scheduledstart", "scheduledend", "scheduleddurationminutes"
     , "description", "new_typeofwork"); // ,  "organizer"); <-- not sure why organizer throws error... not sure i need it
ActivityQry.Distinct = true;
ActivityQry.Criteria = new FilterExpression(LogicalOperator.And);                            
ActivityQry.Criteria.AddCondition("regardingobjectid", ConditionOperator.Equal, ClosedIncident.Id);  // get related appointments  
RelActivities = (EntityCollection)service.RetrieveMultiple(ActivityQry);

I have the same question (0)
  • Suggested answer
    necsa Profile Picture
    3,455 on at

    Hi,

    Is the organizer field on the Form?

  • Anthony A Profile Picture
    230 on at

    Yes, but this code is external, its a small vs c# "app" that pull information from CRM and sends it to an external database for us to invoice customers in our Accounting App.

    I realized that its a party litst and i tried all 3 party list fields in the Entity and all 3 give me the same error.

    I am not sure if i need to use a different method to retreive the "partylistID" from the entity.

  • Suggested answer
    necsa Profile Picture
    3,455 on at

    Hi,

    Please take a reference following links to find your solutions. I know the organizer is not serchable party list field. I didn't try but you can try with Entity collection method.

    community.dynamics.com/.../party-list-fields-in-dynamics-365

    www.c-sharpcorner.com/.../

    stackoverflow.com/.../how-to-get-the-contact-guids-from-a-partylist-in-a-plugin

    crmbusiness.wordpress.com/.../

  • Suggested answer
    Anthony A Profile Picture
    230 on at

    Thanks for the leads, most of them point out how to retrieve the contents of a partylist, but for that I needed the get the  object  field first.

    I tried to read the field directly using a service.retreive with the GUID of the record, but for some odd reason my entityvar.Id was Null (my GUID for each record)

    I have no Logical explanation (someone?)  but the solution is to include "activityid" in the column set. once you add it, you can retrieve the organizer field.  the entityvar.id also gets populated.  I didnt need the activityid so i didnt put it in the query... i guess its a must!

    .

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 29 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans