You need to sign in to do that
Don't have an account?
Manohar kumar
status update on account
Hi,
I have a scenerio where i need to update account status. I have one object named "Application" which is a child object of Account.
If any of the Application status is "Rejected" then i have to put rejected on the account status. Which i am doing with the after insert, after update and after delete trigger on "Application". But my requiremnt is if user changes status manually on accunt, then don't update status ever.
How can i achieve this. Any help will be appriciated.
Thanks,
Manohar
Please try with the below code:
Thanks,
Abhishek Bansal.
All Answers
Hi Manohar,
You can simply acheive this by writing a trigger on Account object. The tigger will fire on before update and always update the Status using the trigger.oldMap. Please let me know if you need any further help on this.
Thanks,
Abhishek Bansal.
Hi Abhishek,
Thanks for your reply. can you pls tell me more about the conditions. I have one boolean field on account called "Automatic update" . Its true by default. From account before update, i can make this false. But my trigger on application also calls this account trigger.
can you pls let me know in details about this.
Thanks,
Manohar
You can do one thing here. Set the value of the checkbox as False from the Application trigger and then use the below code on your account trigger:
Please let me know if you need any information related to this.
Thanks,
Abhishek Bansal.
Hi Abhishek,
One quick question, if account is manually chaged and again any Application is created. Then it will update account, but i dont want that. If its manually updated once then it shouldn't update ever.
Thnaks,
Manohar
Can you please list down you complete requirement here. Please include all the cases so that it would be easy to figure out a solution for you.
Thanks,
Abhishek Bansal.
Hi Abhishek,
Status on the account should update based of the application status values. if user manually changes status on the account then dont change status of that account ever. I had mention this in my question.
please let me know if anything else you need, I tried adding that condition in you above code. But i am not sure where to put that.
Thanks,
Manohar
Please try with the below code:
Thanks,
Abhishek Bansal.