You need to sign in to do that
Don't have an account?

how can i slove the following trigger
Hai guys.
requirment:
write a trigger on account object then trigger will evaluate the salary and will restrict to user to change the values.Use before update and compare trigger.old and trigger.new
please help me to slove this requirment
requirment:
write a trigger on account object then trigger will evaluate the salary and will restrict to user to change the values.Use before update and compare trigger.old and trigger.new
please help me to slove this requirment
https://developer.salesforce.com/trailhead/apex_triggers/apex_triggers_intro
This will give you the basic info on writing this trigger. Once you have these fundamentals down, your actual trigger is going to look something like this:
You haven't said what your evaluation/comparison is so I just stuck on in that will execute my commented line when the old salary is less than the new salary (ie the salary is going up).
That should get you going :)
don't forget your test coverage!!!!!!!!!
i will explain the requirment.
when a user comes to account object change the salary .the salary is not less than old value.
if the salary is less than old salary then restrict the user to enter the value.
If you just want to stop people changing the Salary to a lower value - why don't you use a validation rule? Would be much, much simpler.