I am trying to add a relationship to the factory created relationship of (project & quotes) many to many.
I am doing this inside an aftersave logic hook of the quotes module.
$project = BeanFactory::getBean('Project')->retrieve_by_string_fields(array('name'=>$bean->project_id_c));
$bean->load_relationship('quotes');
$bean->quotes->add('$project');
project_id_c is a relate field.
I have tried several versions of this and I can’t seem to find anything that works.