You need to sign in to do that
Don't have an account?
Alina
What condition must be set so that the record to the doctor is not created if the record already exists at such a time?
trigger visit on Appointment__c (before insert) {
for (Appointment__c app : Trigger.new){
if ()}
app.error('choose another time ');
}
}
}
for (Appointment__c app : Trigger.new){
if ()}
app.error('choose another time ');
}
}
}
Greetings to you!
There are two ways to warn users about conflicts.
1. Using Process Builder and Flows
2. Triggers
Please refer to the below links which might help you further with the above requirement.
https://dayback.com/date-range-conflicts-salesforce/
If you want to use a trigger, first, Create a new (hidden) field: DBk_Conflict__c
Then, create a new validation rule: DBk_Conflict__c = "CONFLICT"
After that, you can write a trigger.
Below is the sample trigger:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas