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
Newbie_edmNewbie_edm 

How to get null record using Triggers?

Hi Guys,

I would like to add record to object B using trigger, this trigger should only add record to B if record A fieldnumber is null/blank, how can we do that?

If(account.fieldnumber == null/blank/empty)

thanks
Best Answer chosen by Newbie_edm
Ray C. KaoRay C. Kao
Yes, the code is like ...

if(recordA.fieldnumber == null) {
  create object B's record...
}

But, you might need to query recordA before you can identify if recordA's information is meet or not meet your criteria to run.

And, since it is a trigger, what is the event to trigger the process? And, also what is the relationship between A and B?