Skip to main content

Notifications

Microsoft Dynamics CRM forum
Answered

How To Set fields When create Appointment using plug-in

editSubscribe (0) ShareShare
ReportReport
Posted on by 884

Hello,

how to set below fields When user create Appointment using plug-in.

1.Populate the Organizer field with the Current User :- Organizer is Party List type

2.Set the Status Reason to Busy

Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How To Set fields When create Appointment using plug-in

    How to set account name filed When create using plugin ?

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,406 on at
    RE: How To Set fields When create Appointment using plug-in

    Hi,

    You can refer this article.

    // Set Appointment Organizer

    --------------------
    // Create the activity party
    Entity organizerParty = new Entity("activityparty");
    organizerParty.Attributes.Add("partyid", new EntityReference("systemuser", <id>));
    
    // Add activityparty to partylist
    EntityCollection organizerCollection = new EntityCollection();
    organizerCollection.EntityName = "systemuser";
    organizerCollection.Entities.Add(organizerParty);
    
    // update oranizer on appointment
    Entity updAppointment = new Entity("appointment", <appoinymentid>);
    updAppointment["organizer"] = organizerCollection;
    --------------
    // Set Appointment to busy
    ---------------
    SetStateRequest request = new SetStateRequest(); request.EntityMoniker = new EntityReference(appointment.EntityName, appointmentId); request.State = new OptionSetValue(3); request.Status = new OptionSetValue(5); service.Execute(request);

    ----------------------------

    Refer the below links for more details-

    https://nishantrana.me/2011/05/17/set-organizer-or-working-with-activityparty-in-crm-2011/

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

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,375 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans