• Outcoursing1
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am having trouble directly setting the Email field in my upsert.  I have custom fields which are also have a type of "email". (np01__home_email__c,  np01__alternateemail__c).   The Email field takes the value of the last custom email field I set in the upsert even if i specifically set Email.  

 

$sObject->fields['npe01__AlternateEmail__c'] = htmlspecialchars(stripslashes(strip_tags($row['email'])));

$sObject->fields['npe01__HomeEmail__c'] = 'test@test.com';

$sObject->fields['Email'] = htmlspecialchars(stripslashes(strip_tags($row['email'])));

$sObject->Email = htmlspecialchars(stripslashes(strip_tags($row['email']))); 

 

 

When i upsert that object, the Email field ends up as 'test@test.com'.   As you can see, I tried to set ->fields['Email'], as well as ->Email to no avail.  

 

Can anyone see anything wrong with what I am doing? 

I am having trouble directly setting the Email field in my upsert.  I have custom fields which are also have a type of "email". (np01__home_email__c,  np01__alternateemail__c).   The Email field takes the value of the last custom email field I set in the upsert even if i specifically set Email.  

 

$sObject->fields['npe01__AlternateEmail__c'] = htmlspecialchars(stripslashes(strip_tags($row['email'])));

$sObject->fields['npe01__HomeEmail__c'] = 'test@test.com';

$sObject->fields['Email'] = htmlspecialchars(stripslashes(strip_tags($row['email'])));

$sObject->Email = htmlspecialchars(stripslashes(strip_tags($row['email']))); 

 

 

When i upsert that object, the Email field ends up as 'test@test.com'.   As you can see, I tried to set ->fields['Email'], as well as ->Email to no avail.  

 

Can anyone see anything wrong with what I am doing?