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)

Dynamics CRM 2011 REST JSON - how to add an organizer to an appointment?

(0) ShareShare
ReportReport
Posted on by 20

When I create an appointment in the client-side script, I understand, I need to add an Organizer via a party list, but can't understand in what format it should be present. Please help!

The example below gives an error on an invalid Organizer field but works without an Organizer. How to add an Organizer?

var appointment = new Object();

appointment
.Subject = "Test Appointment";
appointment
.Description = "Test Appointment created using the BookRequest Message.";
appointment
.ScheduledStart = DateToUTCFormat(new Date(y, m, d, 13, 0));
appointment
.ScheduledEnd = DateToUTCFormat(new Date(y, m, d, 15, 0));
appointment
.Location = "Office";

var organizerParty = new Object();
organizerParty
.partyid = { type: "systemuser", Value: '{0a69fa75-92e3-df11-9ecd-00155d01ce0c}' };

appointment
.Organizer = [ organizerParty ];

*This post is locked for comments

I have the same question (0)
  • Kjell W Profile Picture
    140 on at

    I'd suggest you download and install the oData Query Designer solution from codeplex:

    crm2011odatatool.codeplex.com

    It's a great tool, that generates a query according to your personal selection. After that, you can execute the query and check the result in both the ATOM or JSON format.

    Good practice: create a record in crm. Go to the oData Query Designer, select the fields you need, set up your filter so the query returns only 1 result and check out the format you want.

    Hope this helps. Good luck!!

  • Suggested answer
    Prabhakar Harita Profile Picture
    145 on at

    Hi,

       Party List is like a lookup, except it allows you to select multiple entities to associated with the field. In the CRM SDK, search for "Xrm.Page.data.entity attribute Methods". Please see the example for setting a value for Lookup. It must be an array.

    However when using REST/JSON calls, you have to use EntityReference to support updating or insertion of related entities. There is not direct reference to PartyList in SDK.

    However when you search for "Query Microsoft Dynamics CRM Data Using the REST Endpoint" in SDK, you will see a reference to how to update a Lookup (aka EntityReference).

    Based on what you see here, you can create an array of Entities, if there is more than one participant for the meeting and update the Party List.

    +++++++++++++ SDK Snippet +++++++++++++++++++++++++++++++++++++++++++++++++++

    EntityReference

    The Microsoft.Crm.Sdk.Data.Services.EntityReference type represents a lookup. It corresponds to EntityReference.The following table lists the properties.

    Name Type Description

    Id

    GUID

    The unique ID for the record associated in the lookup.

    LogicalName

    String

    The name of the entity.

    Name

    String

    The value of the primary attribute for the record associated in the lookup.

    The following example is an ATOM XML EntityReference:

    Xml
    <d:PrimaryContactId m:type="Microsoft.Crm.Sdk.Data.Services.EntityReference">
    <d:Id m:type="Edm.Guid">76713858-5e81-df11-afdb-00155dba380a</d:Id> 
    <d:LogicalName>contact</d:LogicalName> 
    <d:Name>Cat Francis (sample)</d:Name> 
    </d:PrimaryContactId>

    The following example is a JSON EntityReference:

    JScript
    "PrimaryContactId" :{
        "__metadata": {"type": "Microsoft.Crm.Sdk.Data.Services.EntityReference" },
        "Id": "78713858-5e81-df11-afdb-00155dba380a",
        "LogicalName": "contact",
        "Name": "Cathan Cook (sample)"
    }
    +++++++++++++ SDK Snippet +++++++++++++++++++++++++++++++++++++++++++++++++++

    Hope this helps.

    Prabhakar Harita
    SAIT Services Inc.

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