Topic by tsans
Content
We have built a custom object Entity_Data.Entities and related it to Contact (Entity = Parent, Contact = Child).
I have an existing Custom Script - PHP file that updates the Contact with various bits of information and now I am trying to add the Entity information to the process but I can’t figure out the syntax to expose that field on the Contact.
I am able to query the Entities object using the following query without issue:
$a_tbl = RNCPHP\ROQL::query("select id from entity_data.entities where entity_id = '".$_entity_id."'")->next();
Now when I try and use the ID value returned from the above query it fails saying column doesn’t exist.
Here is some example code:
$c = RNCPHP\Contact::fetch({some id});
$c->Name->First = 'First Name';
$c->Name->Last = 'Last Name';
$c->CustomFields->core_db_id = $_entity_id;
---This is the line I am having problems with---
$c->CustomFields->Entity_Data->Entities->ID = {value from above query};
$c->save();
RNCPHP\ConnectAPI::commit();
I have tried every combination I could think of but still can’t get it to work.
Any help would be much appreciated.
Thanks,
Todd