Hello everyone,
new day, new problem :pinch:
I’ve got following modules:
Contacts
|
____ Custom1
|
_____ Quotes
I’m creating a new quote with the subpanel in “Custom1”.
Therefore I created a logic hook in AOS_Quotes to load the contact id and to store it in the quote.
The logic hook is getting triggered, but I simply do not now how to get any further…
if (empty($bean->contact_id_c))
{
//Contact empty, get contact
if ($bean->load_relationship('fthue_vorgaenge_aos_quotes'))
{
// ?????
// $bean->contact_id_c = $bean->fthue_vorgaenge->contact_id_c
}
}
Or do I also have to get the relation between “Custom1” and “Contacts”?
The documentation is unfortunatly not very helpful at this point.
Can I use relations at this point, or should Use after_save? Or is the ID for my “Custom1” module in the passed $arguments?
I managed to do this using the Workflow, but only after the record already was created and I hit “save” for the second time. (Set to work on “New records”) Probably beacause the link wasn’t working yet?
Any help would be greatly appreciated.
Kind Regards
Flying Dutchman