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)

How To Set fields When create Appointment using plug-in

(0) ShareShare
ReportReport
Posted on by 894

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

*This post is locked for comments

I have the same question (0)
  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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

  • Community Member Profile Picture
    on at

    How to set account name filed When create using plugin ?

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