You need to sign in to do that
Don't have an account?
Victor Apolinario
Apex - Change Item disponibility when rented
Hi,
I´m going to leave below some pictures of a process builder I created that I really need to change it into a Apex trigger, if someone knows how to please give me this help. Thank you.
I´m going to leave below some pictures of a process builder I created that I really need to change it into a Apex trigger, if someone knows how to please give me this help. Thank you.
Can you try the below 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
This seems to be duplicate for the below question.
https://developer.salesforce.com/forums?dc=Apex_Code_Development#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Apex_Code_Development&criteria=ALLQUESTIONS&id=9062I000000R3zcQAC (https://developer.salesforce.com/forums?dc=Apex_Code_Development#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Apex_Code_Development&criteria=ALLQUESTIONS&id=9062I000000R3zcQAC)
I have taken up the above question. Can you close this question by marking this as best answer so it avoids duplicate efforts by others.
Thanks,
They are different. The other one we needed to change the Status of the Contact based on the Rent Status.
In this one we´re checking the Rent Status to see if it does not equal the string 'Finished', we change the Inventory Item to the Rented Status in the picklist.
If not, we check if the Rent Status does not equal to the strings 'Late' or 'In Progress', and if that is true the Inventory Item Status should change to Available in the picklist.
Is that clearer now?
Hope you can help.
Can you try the below trigger on Rent object.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
In this one I just had to add a after insert in the first line and it worked perfecty.