What is the relationship name between Leads and Calls for logic Hooks?

What I want to do is that Use process_record logic hooks to, in the leads SUBPANEL, let the Calls “subject” field to display the concatenation of the last name and first name of the related Leads record…
the following code won’t code, why? (I saw there is 2 relationship name between the leads and calls)

From my understanding the name of the relationship should be lead_calls

Have you tried outputting something to the screen with echo statements to see what happens?

If you do so remember to put an exit statement during your test otherwise you won’t be able to see the output.

To get to the names of fields and relationships, just check the vardefs. What is in the Beans is what was previously defined in the vardefs.

modules/Leads/vardefs.php (seems to include a ‘calls_leads’ relationship)
modules/Calls/vardefs.php (also has a relationship with same name)

Also, check this file for information on each field, as used in views:

I hope this helps.

No, I tried calles_leads, it does not work, I actually look relationship name up in studio, similarly it works with all my other custom modules, but not work between leads and calls

No, I tried lead_calls as well, it does not work,

try using load_relationship(‘leads’) instead of load_relationship(‘lead_calls’) or load_relationship(‘calls_leads’)

1 Like

Awesome, that WORKS!
But I just found a weird problem, you can experiment it with your lead and call

if I “Quick Create” a call record in the Lead SubPanel, then I do an edit to this newly create record, and hit save again, then this newly created call record is gone… does this happen to you?

I had had issues similar to what you are describing. I think there are topics in the forum with similar situation. Unfortunately I can’t remember now the solution, if any.

I tried to search could not find it, I will start another new post…