Hello,
WHAT I AM DOING:
I am trying to create a custom module for my implementation of sugarCRM 5.0 CE. It is primarily based on the example_module.zip and I have managed to create all the simple elements easily so far. This is my current problem:
MY PROBLEM:
In the accounts subpanel for the widgets module I need it to list widgets belonging to that account (which works) as well as belonging to a contact that belongs to that account. Because I am new to sugarcrm the best way for me to describe it is with sql which would look like this:
SELECT * FROM sugardata.widgets WHERE parent_id = '8f7cf9d0-50e3-569d-a6c1-46966bd7960b' OR parent_id IN (SELECT contact_id FROM sugardata.accounts_contacts WHERE account_id = '8f7cf9d0-50e3-569d-a6c1-46966bd7960b');
If the id of the account producing the subpanel was 8f7cf9d0-50e3-569d-a6c1-46966bd7960b
To summarize in high level sugarcrm terms; if you view the details of an account the widgets subpanel should be all widgets assigned to that account as well as widgets assigned to contacts belonging to that account.
WHAT I WOULD LIKE TO LEARN
What I need to do is specify a custom relationship, or maybe multiple relationships for the link field. If there is a way to specify custom SQL that would work or even use a function instead of a relationship in the $dictionary array, if possible.
WHAT WORKS
Currently I have recreated the widgets module and using a flex relate (as the module builder calls it, but I am not using UI tools so I don't know what else to call it) you can assign a widget to an account or a contact. If you view an account or contact the widget subpanel displays the widgets associated with that entry. This all works.
TECH DETAILS:
SugarCRM 5.0
Running on a localhost test platform using XAMPP for Linux 1.6.4
- PHP Version 5.2.4
- MySQL Version 5.0.45
all files of sugar have been chmod 777 (during testing)
IN CLOSING
Further technical details or code snippets available on request.
I apologize that I repeated my question but I want to be sure it is clear because in the past I have not been very good at explaining things in forums.
Any help is greatly appreciated. Thank you.


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks