Add columns dynamically in child table

Can someone please help me in adding columns in child table dynamically.
Or is there any other way of showing tables like this and saving it’s data?

Thanks in advance…

can you help to provide the business case?

client or server side?

Thanks for replying @szufisher,
I want to :

  1. Fetch items in rows and warehouses(it can be 100 or 5) in columns.
  2. Add fields after every warehouse
  3. Save this table
  4. Set values(warehouse, quantity) to another doctype

@joelios this is my requirement, now you can help me in choosing client side or server side scripting…
Hope u will understand this…

Thanks for replying @joelios,
I am bit confused about this.

The code that will make this automation for you, should it be client side (.js) or server side (.py)?

I’m sorry, but this is an almost irresolvable requirement. Each column in the child table is equal to a column in the database.

Can you please suggest me any other way to achieve this ?

You already have all these informations (article, warehouse, quantity) in the table “Items”, for what do you need another table with the same contents?

I am working on routes, i.e, I will assign warehouses to single route and making more routes like this.

sorry, still not clear enough to understand what business background about your requirements/design, is it feasible to provide mockup screen shot and explanations with sample data?

1 Like

Columns for warehouses and rows for items

I don’t think the Child Table is suitable for this use case. Do you need the cells to be editable? If not, you can try the Report system.

Yes .
I already tried report but it will only fetch data, I want quantity to be stored somewhere or in route table… this table will create a new form with warehouse, item and quantity field fetched in the table…

Well, Reports use Frappe DataTable, which supports editing, so, you can make it work with an arbitrary amount of hard to maintain hacky code :grinning:


Thanks @igrekus, I will try get and back to you.