Ok I actually found a solution. It feels like a dirty hack but whatever. I'll do my best to explain.
During the logic hook, the bean (which in this case is the note that was created) contains variables of type "Link2" that are named after each of the notes relationships (ex. legal_loan_mod_notes_1, legal_loan_mod_notes_2, etc). Underneath the variable that corresponds to the relationship name where you created the note, you'll find another array called "beans". BEANS WILL ONLY BE UNDER THE VARIABLE NAMED AFTER THE TYPE OF NOTE YOU CREATED.... I know this sounds confusing, so let me illustrate:
Scenario: User created a client note (legal_loan_mod_note) and not a lender note (legal_loan_mod_note_1).
The fields in the debugger will look like:
$bean-->legal_loan_mod_note-->beans-->[parent_module_id]
$bean-->legal_loan_mod_note_1-->[no beans array]
So! By checking to see if there are any values under each of the notes relationships variables, you can tell what type of note was created.
Here's the code I used to test my theory:
Code:
$count1_1stLender = count($noteBean->legal_loan_mod_notes->beans);
$count2_client = count($noteBean->legal_loan_mod_notes_1->beans);
$count3_2ndLender = count($noteBean->legal_loan_mod_notes_2->beans);
$count4_3rdLender = count($noteBean->legal_loan_mod_notes_3->beans);
So if I created a client note, $count2_client would have a value of '1' and the rest would have '0'
Bookmarks