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
santhosh konathala 8santhosh konathala 8 

Hi how to check the prior value of field with the new value in trigger

Best Answer chosen by santhosh konathala 8
JethaJetha
for (Test_customObject obj : trigger.new)
{
	if (obj.customfield == trigger.OldMap.get(obj.Id).customfield )
	{
		//Your Code Here
	}

}
Here you go :)

 

All Answers

sslodhi87sslodhi87
Use old and new map to compare the values
JethaJetha
for (Test_customObject obj : trigger.new)
{
	if (obj.customfield == trigger.OldMap.get(obj.Id).customfield )
	{
		//Your Code Here
	}

}
Here you go :)

 
This was selected as the best answer