You need to sign in to do that
Don't have an account?
carmilyn.c martin
Trigger on current year and next year
Hello,
I would like to avoid our users from creating PTO records with pto_date__c of January 10 onwards (of next year). PTO Records of current year is only counted if pto_date__c is within January 11 (current Year) until January 10 of next year.
I would also like to avoid them deleting these PTO records. They cannot delete their PTO records with pto_date__c from January 11 (last Year) to january 10 of this year.
I am not sure how to do this.
I would like to avoid our users from creating PTO records with pto_date__c of January 10 onwards (of next year). PTO Records of current year is only counted if pto_date__c is within January 11 (current Year) until January 10 of next year.
I would also like to avoid them deleting these PTO records. They cannot delete their PTO records with pto_date__c from January 11 (last Year) to january 10 of this year.
I am not sure how to do this.
https://help.salesforce.com/apex/HTViewHelpDoc?id=approvals_useful_approval_processes_pto.htm&language=en
Have you gone through this link?
This gives you an idea to write an approval process for the PTO.
And for preventing from deleting and creating new PTO you must
1.Create a custom field (checkbox) on the PTO object.
2. when the conditions are met then update the checkbox by checking it.
3.Now using the checkbox field as condition write a trigger for preventing user from deletion and also creating new PTO.
Thanks
Thank you.