function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
skdevskdev 

help with trigger

I have an object with a Phase field(picklist), i need to find the time period the record was in one phase.

if the same phase is selected again i need the time to be added. need to display this in dashboard.

 

I have workflow field updates on this object, i am trying to write a trigger to insert/update records into another object with the phase change details.

 

I have written the trigger on After update .... but it is firing when i insert a new record into the object.... as i have field updates

 

the error i get is

Validation Errors While Saving Record(s)
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger TempTrigger caused an unexpected exception, contact your administrator: TempTrigger: execution of AfterUpdate caused by: System.NullPointerException: Argument 1 cannot be null: External entry point".

 

Can anyone suggest me how to solve this.

MandyKoolMandyKool

Hi,

 

Just make sure that you dont have any validation rules on your object. Also if possible you can paste your code here, so that it will be easy to help you out!!