• Sharon Freas
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Probably a stupid question but here goes. I'm a long-time developer but pretty new to SalesForce Apex.

I have a custom object table containing a bunch of user Ids that is partially filled in. I need to assign fields from table to fields on account records.

Right now I am checking before each field assignment if that particular field is null before doing the assignment like:
if (ct.Id1 != null) {
   a.Id1 = ct.Id1;
}

Is there a better way to do this? There's a bunch of fields and it's a pain to write this over and over.

Thanks! 
Probably a stupid question but here goes. I'm a long-time developer but pretty new to SalesForce Apex.

I have a custom object table containing a bunch of user Ids that is partially filled in. I need to assign fields from table to fields on account records.

Right now I am checking before each field assignment if that particular field is null before doing the assignment like:
if (ct.Id1 != null) {
   a.Id1 = ct.Id1;
}

Is there a better way to do this? There's a bunch of fields and it's a pain to write this over and over.

Thanks!