Greetings,
Have been trying to get the Cases Module to be a little more streamlined and came across a few posts here on the forum that have been helpful so far. However I have been banging my head against a wall trying to figure out how to associate Cases to Accounts through Contacts instead of the email address that is associated with the Account.
I have been taking a look at this chunk for a while now:
and this below it:Code:if($accountIds = $this->getRelatedId($contactAddr, 'accounts')) { if (sizeof($accountIds) == 1) { $c->account_id = $accountIds[0]; $acct = new Account(); $acct->retrieve($c->account_id); $c->account_name = $acct->name; } // if } // if
After poking around in the database it would seemsomething along the lines ofCode:if($contactIds = $this->getRelatedId($contactAddr, 'contacts')) { if(!empty($contactIds) && $c->load_relationship('contacts')) { $c->contacts->add($contactIds); } // if } // if
Would be workable but assigning anything like $c->account_id = $myvarID doesn't seem to work to well. Just started taking a look at this today and PHP is not my expertise, starting to wonder if this is harder than I am thinking it is?Code:Select accounts.id From accounts INNER JOIN accounts_contacts ON accounts.id = accounts_contacts.account_id where accounts_contacts.contact_id = {$contactIds[0]}
Thanks for any input!


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks