Currently using a couple different logic hooks to manage records between the leads module and a custom module, and the relationships between them. Easy stuff like “When lead is created, create custom module record and relate” and “When lead is deleted, if custom module has no other relationship, then delete custom module record as well.”
One issue I’m having is using the relationship after using the load_relationship function. When I attempt to add, delete, or getBeans from this relationship, I’m getting a “Call to a member function getBeans() on string” error.
What’s odd is that I’m using the same relationship and loading the exact same way in another logic hook (The one that creates the custom module record upon lead creation) and that same relationship works just fine. I’ve literally copied and pasted the two lines of code just to make sure I’m not missing a typo or something.
What could be causing this inconsistency? I can use the get_linked_beans to get around the retrieval process, but how can I add or delete a relationship if I can’t use the load_relationship function? Any ideas would be appreciated, as I can’t complete my current project without fixing this issue first.