Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
related list only works one way
#1
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?
Reply
#2
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...?
Joe
TSolucio
Reply
#3
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?
Reply
#4
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.
Reply
#5
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.
Joe
TSolucio
Reply
#6
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
Reply
#7
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.
Joe
TSolucio
Reply
#8
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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)