You need to sign in to do that
Don't have an account?
Wik
Trigger on Equipment Object
Hi,
I got to write a trigger for the following requirement:
There are 2 custom objects. Service Agreement object and Equipment object.
Once the equipment has been moved off the service agreement, the ‘Under Contract’ picklist should be defaulted to unchecked and ‘Contract Status’ should changed to ‘Not Under Contract’.
What means "Once the equipment has been moved off the service agreement"? the Equipment has beeen unassigned from Service Agreement?
Where are ‘Contract Status’ and ‘Under Contract’ fields? on Equipment?
Ya once the equipment is un assigned from the service agreement.
Service agreement and Equipment are in a loookup relationship.
Contract Status and Under Contract are custom fields on the Equipment object.
Ok, try this:
But probably is better do it on a workflow.
I got the following error:
Review all error messages below to correct your data.
Apex trigger UnAssignServiceAgreement caused an unexpected exception, contact your administrator: UnAssignServiceAgreement: execution of AfterUpdate caused by: System.FinalException: Record is read-only: Trigger.UnAssignServiceAgreement: line 4, column 1