Jump to content


Set Relation Function For Joing Multiple Tables

set relation join multiple tables

  • Please log in to reply
3 replies to this topic

#1 Neelim Sahariah

Neelim Sahariah

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 22 March 2017 - 03:42 PM

Hi All,

 

I am new to Grocery Curd. I am working with relations and able to use the set relation function to join tables. However I need to join three tables to get a consolidated view of some data. I have attached an image of table structure with  sample data and desired output. Please help me on retrieving/updating the data in the format i have mentioned.

 

Thanks in advance!

Attached Thumbnails

  • grocerycurd photo.jpg


#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 27 March 2017 - 09:09 AM

Hi Neelim Sahariah

 

Can yo please explain in as what is it that you are looking in for as a solution. We can understand the table structure.. but what is it that you wana display / select in the form / list. If u can clarify .. where is it you finding the difficulty it will be much clearer to understand and provide u solution



#3 Neelim Sahariah

Neelim Sahariah

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 03 April 2017 - 03:16 AM

I have three tables, . in the view mode I want to display the following columns product_category_name, product_name, product_code, price_n, rawmterials_name, quantity and supplier detail.
by joining all three tables, In the edit action all the fields I want to show. once saved it will update data in tb_product_master and tb_product_rawmaterial_Details table. I am not able to join the tables using set relation function to display in view and edit action. How can I achieve this?



#4 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 06 April 2017 - 06:08 AM

Sorry for delay - unfortunately was more of out of time. As for update on the same,

If u wana show something with nested relations.. u will not be directly .. possible with the existing code .. but u have an option for callback.

As the same goes, when u want to do the same with insert - u got to do it with adding extra fields .. determining the field types as required. And a callback for insert or after insert ... where u have opportunity to handle the insert your way or u may do the extra inserts in other tables post the insert of the record.

 

Happy GCing :)







Also tagged with one or more of these keywords: set relation, join, multiple tables

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users