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
Linked2MarkLinked2Mark 

Are changes to trigger.new visible to subsubsequent methodds called on trigger.new?

Might seem like a dumb question but I would like to confirm this with the community.

I am checking inbound data from another system that inserts (essentialy) a CSV into a custom object that I have created. I  have multiple validity checks that run on the data and I would like to use multiple methods of the same class to analyze the inbouund data.

So - if pass trigger.new to say - method 1 - which makes changes to the trigger and then in the very next line pass the trigger to mthod 2, are the changes made in method 1 preserved and visible by method 2?
This seems like it should be something I should know but I have never actually done this.

Many thanks
Best Answer chosen by Linked2Mark
DimondDimond
I believe its still in the same context so yes.

All Answers

DimondDimond
I believe its still in the same context so yes.
This was selected as the best answer
Linked2MarkLinked2Mark
That is what I thought as well. Let's see if anyone else has a different answer.