pse.ScheduleSaveDTO
global with sharing class ScheduleSaveDTO
This object stores a schedule and allows changes to its schedule exceptions.
Properties
ScheduleId |
Id |
The ID of the schedule record. Leave blank if you are inserting a new record or provide the existing value if you are updating a record.
|
StartDate |
Date |
The start date of the schedule.
|
EndDate |
Date |
The end date of the schedule.
|
MondayHours |
Decimal |
Hours scheduled for Mondays.
|
TuesdayHours |
Decimal |
Hours scheduled for Tuesdays.
|
WednesdayHours |
Decimal |
Hours scheduled for Wednesdays.
|
ThursdayHours |
Decimal |
Hours scheduled for Thursdays.
|
FridayHours |
Decimal |
Hours scheduled for Fridays.
|
SaturdayHours |
Decimal |
Hours scheduled for Saturdays.
|
SundayHours |
Decimal |
Hours scheduled for Sundays.
|
CustomFieldsData |
Map<SObjectField, Object> |
A map of field to value. Use CustomFieldsData to write data to custom fields on pse__Schedule__c. For example externalId fields used in integrations.
|
ExceptionsToInsert |
List<pse.ScheduleSaveDTO.ScheduleExceptionDTO> |
A list of schedule exceptions to be added to this schedule.
|
ExceptionsToUpdate |
List<pse.ScheduleSaveDTO.ScheduleExceptionDTO> |
A list of schedule exceptions to be updated on this schedule.
|
ExceptionsToDelete |
Set<Id> |
The IDs of schedule exceptions to be deleted from this schedule.
|
Methods
pse.ScheduleSaveDTO.ScheduleExceptionDTO
global with sharing class ScheduleExceptionDTO implements Comparable
Properties
ScheduleExceptionId |
Id |
The ID of the schedule exception record. Leave blank if you are inserting a new record or provide the existing value if you are updating a record.
|
StartDate |
Date |
The start date of the schedule exception.
|
EndDate |
Date |
The end date of the schedule exception.
|
MondayHours |
Decimal |
Hours scheduled for Mondays.
|
TuesdayHours |
Decimal |
Hours scheduled for Tuesdays.
|
WednesdayHours |
Decimal |
Hours scheduled for Wednesdays.
|
ThursdayHours |
Decimal |
Hours scheduled for Thursdays.
|
FridayHours |
Decimal |
Hours scheduled for Fridays.
|
SaturdayHours |
Decimal |
Hours scheduled for Saturdays.
|
SundayHours |
Decimal |
Hours scheduled for Sundays.
|
ExceptionHours |
Decimal |
Indicates the exception hours.
|
CustomFieldsData |
Map<SObjectField, Object> |
A map of field to value. Use CustomFieldsData to write data to custom fields on pse__Schedule_Exception__c. For example externalId fields used in integrations.
|
ValidationErrors |
List<String> |
Set by PSA when saving. A non-empty list indicates this Exception overlaps with other exceptions on the same schedule.
|
SaveErrors |
List<String> |
Set by PSA when saving. An empty list indicates the record was saved successfully.
|
Methods
pse.ScheduleSaveDTO.SaveResult
global with sharing class SaveResult
Contains the results of saving a ScheduleSaveDTO, including the IDs of newly created records and any validation or database errors.
Properties
ScheduleId |
Id |
The ID of the schedule record, if known.
|
Valid |
Boolean |
If true, it indicates that no validation errors were found. If false, check the InsertExceptions and UpdateExceptions for details.
|
Success |
Boolean |
If true, it indicates that the validation was successful, and all the records were saved successfully.
|
SaveErrors |
List<String> |
Any errors occurred while saving the schedule record. Errors related to specific schedule exceptions are stored separately. Only used when saving with allOrNone=false.
|
InsertExceptions |
List<pse.ScheduleSaveDTO.ScheduleExceptionDTO> |
All the exceptions provided in ExceptionsToInsert with ID populated when save was successful. ValidationErrors is populated on any with validation errors. SaveErrors is populated with any errors saving when allOrNone=false.
|
UpdateExceptions |
List<pse.ScheduleSaveDTO.ScheduleExceptionDTO> |
All the exceptions provided in ExceptionsToUpdate. ValidationErrors is populated on any with validation errors. SaveErrors is populated with any errors saving when allOrNone=false.
|
DeleteExceptionsErrors |
Map<Id, List<String>> |
Any Schedule Exceptions that fail to be deleted when allOrNone is set to false will be added here along with the error messages.
|
InvalidDatabaseScheduleExceptions |
Set<Id> |
The IDs of schedule exceptions that were found in the database that overlap with the provided data.
|
|