The table below provides a comprehensive overview of all fields and relationships for the Resource object in Maica. Please refer to the table below for detailed information.
Click here to view and download the complete Resource Schema.
Validation Rules
The list below outlines the Validation Rules applied to the Resource Object in Maica.
Please refer to the list below for more detailed information on each Validation Rule.
End Date Must Not Be Before Start Date
Ensures that the End Date cannot be before the Start Date.
Validation Rule Detail
Rule Name
VAL_RESOURCE_0001
Error Message
VAL_0001: The End Date cannot be before the Start Date.
Required Resource Attributes when Resource type is Resource
This validation rule ensures key Resource attributes are populated when the Resource Type is Resource. These attributes are:
Employment Type
Weekly Hours Limit
Daily Hours Limit
Weekly Hours Minimum
Validation Rule Detail
Rule Name
VAL_RESOURCE_0002
Error Message
VAL_0002: When the Resource Type is Resource, the following fields are required: Employment Type, Weekly Hours Limit, Daily Hours Limit, Weekly Hours Minimum.
The list below outlines the Flows applied to the Resource Object in Maica.
Please refer to the list below for more detailed information on each Flow.
Resource Geocoding
This Salesforce Autolaunched Flow is designed to geocode addresses for resources, updating their latitude and longitude based on the provided address information.
Flow Detail
Flow Label
Maica - Resource Geocoding
API Name
maica__Maica_Resource_Geocoding
Type
Autolaunched Flow
Flow Summary
This flow facilitates the geocoding of resource addresses by:
Detecting changes to resource records and ensuring address fields are populated.
Calling an Apex action to geocode the address.
Updating the resource record with the geocoded latitude and longitude.
Flow Description
Start (Record-Triggered Flow):
The flow is initiated upon the creation or update of a resource record.
Checks if the latitude and longitude are set to 0.0 and ensures that the address fields (City, Street, State, and Postal Code) are not null.
Proceeds to geocode the address asynchronously after the record is saved.
Geocode the Address (Apex Action):
Calls the GeocodeAddressInvocableProc Apex action to geocode the address.
Passes the address fields and the record ID as input parameters.
Captures the latitude and longitude from the geocoding result.
Proceeds to the Error decision.
Error? (Decision):
Checks if there is an error message from the geocoding process.
If no error, proceeds to update the resource record with the geocoded latitude and longitude.
If an error is detected, the flow ends.
Update Resource (Update Records):
Updates the resource record with the latitude and longitude from the geocoding result.
Ends the flow.
Trigger Handlers
The list below outlines the Trigger Handlers applied to the Resources Object in Maica.
Please refer to the list below for more detailed information on each Trigger Handler.
Resource Deactivation
This trigger is designed to manage the deactivation of resources in Maica.
Detail
Load Order
1
Label
ResourceDeactivation_MDTM
Execution, Logic & Outcome
Trigger Execution
The trigger logic defined in the ResourceDeactivation_MDTM class is executed when the trigger conditions are met.
Trigger Conditions:
When a new resource (maica__Resource__c) is created.
When an existing resource is updated.
Any specific field changes that are monitored by the trigger (defined in the handler class).
Logic Explanation
Initialisation:
When a resource record is created or updated, the trigger is initialised. The ResourceDeactivation_MDTM metadata type configuration is loaded, ensuring that the trigger is active (Active__c is true) and has the correct load order (Load_Order__c is 1.0).
Trigger Execution:
Upon initialisation, the trigger executes the logic defined in the ResourceDeactivation_MDTM class.
The class methods perform the following steps:
Validation: The resource status and related data are validated to ensure they meet the criteria required for deactivation.
Deactivation: The deactivation process is applied based on predefined criteria such as resource status and utilisation.
Update: Related records are updated, and relevant stakeholders are notified if necessary.
Trigger Outcome:
Once executed, the trigger ensures that each resource is deactivated correctly, based on the logic defined in the handler class. This helps maintain data integrity and operational efficiency.
Resource Geocoding
This trigger is designed to manage the geocoding of resources in Maica.
Detail
Load Order
2
Label
ResourceGeocode_MDTM
Execution, Logic & Outcome
Trigger Execution
The trigger logic defined in the ResourceGeocode_MDTM class is executed when the trigger conditions are met. The class contains the code that manages the geocoding process for resources.
Trigger Conditions:
When a new resource (maica__Resource__c) is created.
When an existing resource is updated.
Any specific field changes that are monitored by the trigger (defined in the handler class).
Logic Explanation
Initialisation:
When a resource record is created or updated, the trigger is initialised. The ResourceGeocode_MDTM metadata type configuration is loaded, ensuring that the trigger is active (Active__c is true) and has the correct load order (Load_Order__c is 2.0).
Trigger Execution:
Upon initialisation, the trigger executes the logic defined in the ResourceGeocode_MDTM class.
The class methods perform the following steps:
Validation: The resource address data is validated to ensure it is complete and accurate.
Geocoding: The validated address data is converted into geographical coordinates using geocoding services.
Update: The resource record is updated with the newly obtained geographical coordinates.
Trigger Outcome:
Once executed, the trigger ensures that each resource is geocoded correctly, based on the logic defined in the handler class. This helps maintain accurate geographical data for resources.