Full Version: related list only works one way
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I never noticed this, but I'm getting a complaint about it. When creating a purchase order from a salesorder's related list (for example), the salesorder appears in the new purchase order's related list, but not the other way around. Is there any way I can fix this?
Those two modules are not related in a standard coreBOS so the question is: How did you relate them? get_dependent_list, get_related_list, other...?
I related them some time ago, but honestly I don't remember which method I used (I didn't know there were multiple). It may even be that I created a row in the database for the relation. What's the difference between the two methods?
OK, I figured out what the difference between get_related_list and get_dependents_list is. I've created a UI10 field in PurchaseOrders and setup a get_dependents_list entry. But I'd like to add BOTH related types to salesorders. So a  related list that shows but the related through a UI10 field, and the related through the vtiger_crmentityrel table. Is that even possible?

Also, the problem I have when setting up a relation through get_related_list is creating a new record in this way does not setup a row in vtiger_crmentityrel.
To show both relations in one list you will have to create a custom function. Basically, add a new get_related_records() method that does a UNION of get_dependents and get_related queries.
Cool, I'll do that. Maybe create a PR? I think it would be a neat function for the core. One question, do all relation function receive the same variables? Like
PHP Code:
function get_related_list($id$cur_tab_id$rel_tab_id$actions false
Interesting, I hadn't thought of that as a base code functionality, but it makes a lot of sense. Yes, I would accept a PR for that.

Yes, they all receive the same parameters.
Sadly, as discussed on Gitter this proves to be a lot more difficult than I initially thought. Hope for better days but for now I've given up on it.