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.
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.
- Make sure your class is a partial DsAppointmentHandler class
- Make sure the method name is unique and maps with a DS Source Type Processing Action in CRM
- Execute any logic based on the DsAppointment variable’s values.
Each DsAppointmentHandler instance contains the following objects:
|Service||An instance of the CRM OrganizationService Proxy|
|DsAppointment||An instance of the DsAppointment record. It should contain all fields of the CRM Entity|
|DsResources||A list of resources linked to the DsAppointment|
|DsFieldValues||A list of field values linked to the DsAppointment|
|TransactionType||An 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.
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:
|Source Type||The 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 App||The 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 Identifier||The unique id of the appointment within Dime.Scheduler. This id allows you to update the appointment in CRM.|
|Subject||The subject of the appointment as shown in Dime.Scheduler. When you update the appointment from CRM you can: |
|Body||The body text of the appointment as shown in Dime.Scheduler. When you update the appointment from CRM you can: |
|Start||The start date and time of the appointment.|
|End||The end date and time of the appointment.|
|Is All Day Event||Indicates whether the appointment lasts the entire day.|
|Time Marker||The 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.|
|Category||The 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.|
|Importance||The importance or priority of the appointment. Values are: |
|Duration||The 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 Quantity||The planned quantity expressed in the Unit of Measure. Calculated as: (Duration (Sec.) – Non Working Time (Sec.)) / Planning UoM Conversion|
|Planning Unit of Measure||The Unit of Measure code|
|Planning UoM Conversion||The conversion from seconds to the Unit of Measure|
|Use Fix Planning Quantity||Indicates 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 Measure||Indicates whether Duration (Sec.) is rounded to the Unit of Measure. Rounding is performed in Dime.Scheduler|
|Last Modified Date||Date and time of the last modification|
|Last Modified User||User that made the last modification|
|Created Date||Date and time when then appointment was first created|
|Created User||User that created the appointment|
|Sent From Backoffice||Indicates whether the update of the appointment was made by the user (False) or by the back office (True)|
|Backoffice Id||Optional 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 Id||Optional 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 Action||Indicates whether the appointment was created, modified or deleted in Dime.Scheduler. Values are:|
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.
|Status||Status of the appointment record in CRM. Values are: |
|Error||An 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 Message||When an error occurs during the processing of the appointment record then this field will contain the last known error.|
|Created On||The date and time when the appointment record was received by CRM.|
|Force Synchronous Processing||When this field is set to yes, the processing actions will be called synchronously. Any errors that occur will be thrown by the platform.|