Hey all, I’ve been looking around over the weekend for a solution but am still stumped on this. I’m looking for a function refresh a link field in a child table, so that the fetch fields are populated when the link field isn’t inputted manually.
Case:
Using the “Project” field in “Sales Invoice” will populate the ‘timesheets’ child table with billable timesheets.
(GitHub commit)
Currently have fields and client side fetches for additional info (note, employee, start date) that will populate if the timesheet name is manually selected, but not when inputted using the new method.
I feel like the use of set_value in a dynamic sense, especially in a table, is beyond my understanding at this point. Is there any method that can be called to refresh a link field on custom_validate or anything?
Hey! thanks for replying. I haven’t had any result trying to trigger refresh_field for child doc table, or child doc field.(script held in parent doc), so I don’t know what other triggers are able to refresh those link fields, and have fetch fields react accordingly.
I would be happy to reciprocate if anybody would like to help!
hi @superlack! It would be best if you can share your script here so that we can check what’s missing. But anyway, if you wanted to refresh child table try this:
frm.refresh_field("items")
You should put it inside your loop setting the value to the child doctype.
I’ve been browsing around, also while trying several combinations of script to have this active, but still no luck. Is anybody aware of any methods to retrigger a link field to get fetched fields to work?
I found that using origin_doc.origin_field as an option in the custom field triggers the fetch properly except for longtext. Is there any way to overcome this, or is it a bug when it comes to framework?
For reference, the field was within “Sales Invoice Timesheet” and fetched additional information required, probably on a refresh trigger, but “save” has done the job
Also (barely) visible is the timesheet note field, which is a longtext field that has the same option that doesn’t work