Aint able to add values to relationship
Hi ppl,
I have any entry point where we create an lead for webform.
We also make contact and opportunity for the same lead.
The issue is that im unable to get the value of contact in the oppurtunity on the contact sub-panel.
I get the value of related lead in the lead sub panel in the oppurtunity.
But not the contact that is related to this lead.
PHP Code:
$opp_new = new oppurtunity();
.
.
$opp_new2->subject_c = $subject;
$opp_new2->assigned_user_id = 1;
$opp_new2->save();
$lead2 = new Lead();
$lead2->retrieve($lead_id);
.
.
$lead2->opportunity_id = $opp_new2->id;
$lead2->save();
$opp_new2->load_relationship('opportunities_contacts');
$opp_new2->opportunities_contacts->add($lead2->contact_id);
This give me an error call to non object on add (dun have the exact error)...
The contact was created and contact_id was saved in lead created.
Any idea what's wrong and why are the values not added in the relationship?
If It Is To Be, It Is Up To Me
Bookmarks