You need to sign in to do that
Don't have an account?
Victor Apolinario
Apex - Can´t rent a Rented item
Hello
I have a validation rule that prevents a Inventory Item with the Rented status, to be rented by someone else, 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.
If you need any other information, feel free to ask.
Thank you
I have a validation rule that prevents a Inventory Item with the Rented status, to be rented by someone else, 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.
If you need any other information, feel free to ask.
Thank you
Can you try the below apex trigger on Rent object.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
Exactly.
I need to do the exator same thing this validation rule does, but now with a Apex Trigger.
Is this similar to that if new rent it getting created and iinventory Itsm status wirh Rented should not be able to save in new record?
Thanks,
In this one is basically checking if the Inventory Item status is 'Rented'. If yes, when a new rent is being created and someone try to rent this item they won´t be able to (because it´s already rented).
I think this way is more clear for you.
Thank you
Can you try the below apex trigger on Rent object.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,