Topic by Deepthi Suresh
Hi,
I have a scenario where in the old contact details need to be copied into the newly created contact in CPM.
When i am trying to the same the values get assigned but not getting saved in database.
Code sample :
$con = new RNCPHP\Contact();
$con->Name->First = $obj->Name->First;
$con->Name->Last = $obj->Name->Last;
print_r($obj->Emails[0]->Address);
print_r($obj->Emails[0]->AddressType->LookupName);
if(isset($obj->Emails[0]))
{
if(!empty($obj->Emails[0]->Address))
{
$con->Emails = new RNCPHP\EmailArray();
$con->Emails[0] = new RNCPHP\Email();
$con->Emails[0]->AddressType=new RNCPHP\NamedIDOptList();
$con->Emails[0]->AddressType->LookupName = "Email - Primary";
$con->Emails[0]->Address = $obj->Emails[0]->Address;
}
}
The Hard coded values get saved in Database.
Please let me know if there something have to change or any other reason for values not getting saved.
Thanks in advance for the help.
Thanks and Regards,
Deepthi Suresh