zoukankan      html  css  js  c++  java
  • Force SDK to create Appointment programmatically in crm 2013 onPremise

    As I know based on this:

    msdn.microsoft.com/.../gg334289.aspx

    and

    community.dynamics.com/.../book-an-appointment-in-microsoft-dynamics-crm-2011-using-c-or-jscript.aspx

    This request is to validate and book appointment if valid.

    _appointmentId = booked.ValidationResult.ActivityId;

                       // Verify that the appointment has been scheduled.

                       if (_appointmentId != Guid.Empty)

    I would suggest you to create your own pop up.

    The logic is

    you add one more Else after

    if (_appointmentId != Guid.Empty)

    It does mean the user is not available, and since you are building windows app, create your own window, and you can force it by skipping this validation, instead, using your own pop up, and if the user says yes, you just create appointment using common create request.

    So, if the BookRquest is properly used for validation and booking purpose, see this as well:

    Description = "Test Appointment created using the BookRequest Message.",

    Then to force, you just create an Appointment using standard Create message:

    msdn.microsoft.com/.../gg334604.aspx

    or

    public void CreateRequiredRecords()

           {

               // Create a contact

               Contact newContact = new Contact

               {

                   FirstName = "Lisa",

                   LastName = "Andrews",

                   EMailAddress1 = "lisa@contoso.com"

               };

               _contactId = _serviceProxy.Create(newContact);

               Console.WriteLine("Created contact: {0}.", newContact.FirstName + " " + newContact.LastName);

               // Create ab activity party

               ActivityParty requiredAttendee = new ActivityParty

               {

                   PartyId = new EntityReference(Contact.EntityLogicalName, _contactId)

               };

               // Create an appointment

               Appointment newAppointment = new Appointment

               {

                   Subject = "Test Appointment",

                   Description = "Test Appointment",

                   ScheduledStart = DateTime.Now.AddHours(1),

                   ScheduledEnd = DateTime.Now.AddHours(2),

                   Location = "Office",

                   RequiredAttendees = new ActivityParty[] {requiredAttendee}

               };

               _appointmentId = _serviceProxy.Create(newAppointment);

               Console.WriteLine("Created {0}.", newAppointment.Subject);

           }

    Thank you.

    Source:http://community.dynamics.com/crm/f/117/t/146823

  • 相关阅读:
    [CocosCreator]-12-音频播放
    [CocosCreator]-11-文本输入-EditBox 组件
    [CocosCreator]-10-Button(按钮)
    深入理解正则表达式高级教程
    正则表达式匹配次数
    如何理解正则表达式匹配过程
    正则表达式工具RegexBuddy使用教程
    正则表达式批量替换通过$
    正则前面的 (?i) (?s) (?m) (?is) (?im)
    Net操作Excel_NPOI
  • 原文地址:https://www.cnblogs.com/youfeng365/p/5846681.html
Copyright © 2011-2022 走看看