Skip to main content

Receiving data

Deprecated

The Microsoft Dynamics CRM connector is deprecated. We recommend the Power Platform connector for Microsoft Dynamics 365 Sales Microsoft Dynamics 365 Marketing, Microsoft Dynamics 365 Customer Service, and any other solution in the Microsoft Dynamics 365 solution suite.

When planning a task in Dime.Scheduler, an appointment is created. The appointment is immediately sent back to the CRM web services.

For every change to an appointment in Dime.Scheduler, whether a new appointment is created or an existing appointment is modified or deleted, a new DS appointment entity is created. For each resource linked to an appointment – Dime.Scheduler supports multiple resources to be linked to a single appointment – a new DS appointment resource entity is created and linked to this DS appointment. You can follow-up on these operations in the DS appointments view.

Go to: Dime.Studio -> DS Appointments

The "DS appointment" record and its linked "DS Appointment Resource" records are processed by the ProcessDsAppointment.cs plugin. The source type that was sent with the task (to which the appointment belongs) and which is returned with the appointment is then used to determine which 'Processing Actions' need to be taken to further processes the appointment’s data into CRM.

This offers all the flexibility to handle planning or scheduling data in standard entities, custom entities or entities that are part of a vertical solution. This also guarantees that the appointment data is processed entirely through the business logic of CRM.

Developing a Receive method

To create your own processing actions, add a new partial class in the "Custom > ReceiveMethods" folder of the Visual Studio Solution. Each processing method should be contained in a partial class of the DsAppointmentHandler class. You can also group multiple processing methods into a single C# file. Each processing method should always be created without parameters.

You can access the DS Appointment and the DS Appointment Resources from within the Processing Method by using the DsAppointment and DsResources properties of the DsAppointmentHandler instance.

  1. Make sure your class is a partial DsAppointmentHandler class
  2. Make sure the method name is unique and maps with a DS Source Type Processing Action in CRM
  3. Execute any logic based on the DsAppointment variable’s values.

Example:

Each DsAppointmentHandler instance contains the following objects:

FieldValue
ServiceAn instance of the CRM OrganizationService Proxy
DsAppointmentAn instance of the DsAppointment record. It should contain all fields of the CRM Entity
DsResourcesA list of resources linked to the DsAppointment
DsFieldValuesA list of field values linked to the DsAppointment
TransactionTypeAn enumerated value containing the Database operation performed in Dime.Scheduler.

Calling a Receive-method

Receive methods are automatically called whenever a DS Appointment record needs to be processed. Processing occurs whenever the status of the record is set to New or, when manual processing is triggered from CRM.

Manual Processing

You can manually call the processing triggers by opening the DS Appointment record in CRM. Any error that occurred during its processing will be visible. By using the 'Process' button in the command bar, the DS appointment will be re-processed.

The appointment table:

Field Name
Source TypeThe source type that is sent with the task to Dime.Scheduler is returned with the appointment. The source type defines how the appointment data is processed in CRM.
Source AppThe source app that is sent with the task to Dime.Scheduler is returned with the appointment.
Job No.Contains the identification of the job, the parent of task. Examples include the service order, sales order, job or production order number.
Task No.Contains the identification of the task. For example, the CRM GUID or sales order line number or the job task number.
Appointment IdentifierThe unique id of the appointment within Dime.Scheduler. This id allows you to update the appointment in CRM.
SubjectThe subject of the appointment as shown in Dime.Scheduler. When you update the appointment from CRM you can:
  • Return the subject
  • Send an empty subject.
  • The subject is then generated by Dime.Scheduler as defined by the setup templates
  • Specify another value thereby overwriting the subject in Dime.Scheduler. This allows you to send data from CRM as part of the subject shown in Dime.Scheduler and is yet another example of how to display status information in Dime.Scheduler based on the data and business logic of CRM.
BodyThe body text of the appointment as shown in Dime.Scheduler. When you update the appointment from CRM you can:
  • Return the body
  • Send an empty body. The body is then generated by Dime.Scheduler as defined by the setup templates
  • Specify another value thereby overwriting the body in Dime.Scheduler. This allows you to send data from CRM as part of the body shown in Dime.Scheduler.
StartThe start date and time of the appointment.
EndThe end date and time of the appointment.
Is All Day EventIndicates whether the appointment lasts the entire day.
Time MarkerThe current value of the time marker. You can use the appointment Update functions to change the time marker in Dime.Scheduler based on the data and business logic of CRM.
CategoryThe current value of the category. You can use the appointment Update functions to change the category in Dime.Scheduler based on the data and business logic of CRM.
ImportanceThe importance or priority of the appointment. Values are:
  • 0 = None or Medium
  • 1 = High
  • 2 = Low
DurationThe duration of the appointment calculated in hours, minutes and seconds.
Duration (Sec.)The duration of the appointment in seconds. Seconds is the base unit of measure for Dime.Scheduler
Non Working Time (Sec.)The amount of non-working time when an appointment spans an Auto-extend TimeSlot
Planning QuantityThe planned quantity expressed in the Unit of Measure. Calculated as: (Duration (Sec.) – Non Working Time (Sec.)) / Planning UoM Conversion
Planning Unit of MeasureThe Unit of Measure code
Planning UoM ConversionThe conversion from seconds to the Unit of Measure
Use Fix Planning QuantityIndicates whether the Planning Quantity is editable by the user in Dime.Scheduler (True) or calculated based on Duration (Sec.) (False=default)
Round To Unit Of MeasureIndicates whether Duration (Sec.) is rounded to the Unit of Measure. Rounding is performed in Dime.Scheduler
Last Modified DateDate and time of the last modification
Last Modified UserUser that made the last modification
Created DateDate and time when then appointment was first created
Created UserUser that created the appointment
Sent From BackofficeIndicates whether the update of the appointment was made by the user (False) or by the back office (True)
Backoffice IdOptional parameter that can be sent from the back office to link the appointment to a specific record. This information is simple returned by Dime.Scheduler.
Backoffice Parent IdOptional parameter that can be sent from the back office to indicate the parent record of the record to which the appointment is linked. This information is simple returned by Dime.Scheduler.
Database ActionIndicates whether the appointment was created, modified or deleted in Dime.Scheduler. Values are:
  • I = Insert
  • U = Update
  • D = Delete

Note: if an appointment is rescheduled in Dime.Scheduler from one resource to another, then Dime.Scheduler sends 2 appointment records: a Delete database action for the original resourceand a Create database action for the second Resource.
StatusStatus of the appointment record in CRM. Values are:
  • Draft: the appointment record is being sent to CRM
  • New: the appointment record was received by CRM but not yet processed.
  • Processed: the appointment record was successfully processed by CRM.

ErrorAn error occurred during the processing of the appointment record. It is up to the user to take the necessary corrective actions after which the appointment record can be processed again
Error MessageWhen an error occurs during the processing of the appointment record then this field will contain the last known error.
Created OnThe date and time when the appointment record was received by CRM.
Force Synchronous ProcessingWhen this field is set to yes, the processing actions will be called synchronously. Any errors that occur will be thrown by the platform.