You need to sign in to do that
Don't have an account?
Victor Apolinario
Apex - Block Contact Defaulting to rent Items.
Hi guys,
I created a validation rule a while ago to prevent a contact with the "Defaulting" Status to rent a item. And now I need to change that to a Apex Trigger, can you help me with that?
The object of this validation rule is Rent__c.
Thank you
I created a validation rule a while ago to prevent a contact with the "Defaulting" Status to rent a item. And now I need to change that to a Apex Trigger, can you help me with that?
The object of this validation rule is Rent__c.
Thank you
Can you try the below trigger logic.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
Do you mean that when creating a new rent record you should not be able to select contact which status is Defaulting? Do you need this validation via Trigger?
Thanks,
Basically yes. What we need to do here is when a new rent is being created, I will select a contact that is renting the item and if the Status of the contact that is trying to rent the item is 'Defaulting' then he won´t be able to rent, only if his status is 'Normal'.
So I can´t finish creating a new rent if the contact I selected is 'Defaulting'.
I made a validation rule for that but now I need a Apex Trigger to do that.
I hope this made it more clear for you.
If you need to check the name of any field or object just let me know.
Thanks
Thanks for confirming the requirement. I will share the apex trigger code for the same in some time.
Thanks,
Can you try the below trigger logic.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,