Is it possible to override the query of a child table? How?

I have a many to many to many situation.

Many actions can be performed on many widgets for many customers and warehouse locations.

When altering details of a widget it is useful to view actions taken on it. Having a separate report is ok, but having the report appear as a read-only child table would be better. The data is already recorded by actions elsewhere so there is no need to save redundantly to the child table doctype.

How can I fill the child table from a different query than the child table’s default query?

Ideally I would like this to happen on the server side, so:

Is there something like a server-side onLoad() method on a doctype that allows the data retrieved from the database to be altered before it is passed on to the client-side?

Hi. I am in a similar predicament. I’m trying to set a query on child table field but can’t find anything. Could you kindly share the solution if you found it?

refer to:
https://frappeframework.com/docs/v13/user/en/guides/app-development/overriding-link-query-by-custom-script

or find this code in the erpnext codebase to see sample usage:

frm.set_query

you can also share your code so we can help. :slight_smile:

2 Likes

Thanks. I will look into it.

1 Like