Table Multiselect - TypeError: undefined is not an object (evaluating 'e.fields')

I have created a custom doctype which is linked inside the Event doctype as Table Multiselect

Unfortunately, I cannot open the table row to edit the table multiselect field and in the browser console this error appears:

TypeError: undefined is not an object (evaluating 'e.fields')

get_link_field — table_multiselect.js:137
set_formatted_input — table_multiselect.js:110
(anonymous function) — class.js:53
set_input — data.js:76
n — base_input.js:69
refresh_input — base_input.js:88
refresh — base_control.js:85
attach_doc_and_docfields — layout.js:325
refresh — layout.js:223
render — grid_row_form.js:24
show_form — grid_row.js:524
toggle_view — grid_row.js:510
(anonymous function) — grid_row.js:231
dispatch — jquery.min.js:3:7543
handle — jquery.min.js:3:5626
http://URL RETRACTED/assets/js/

Any help will be very much appreciated !

Any idea anyone ? it’s a bit important … haha

I’ve tried in many ways and followed the ERPNext tutorial for this field … nothing works, issue is the same.

I’ve done bench build and even upgraded erpnext … issue is the same.

Any idea what’s up ? I’m on a macOS with Safari browser.

UPDATE: Confirming it’s not working on Google Chrome neither… here’s what shows up in google chrome console:

Uncaught TypeError: Cannot read property 'fields' of undefined
    at o.get_link_field (table_multiselect.js:137)
    at o.set_formatted_input (table_multiselect.js:110)
    at o.set_formatted_input (class.js:53)
    at o.set_input (data.js:76)
    at n (base_input.js:69)
    at o.refresh_input (base_input.js:88)
    at o.refresh (base_control.js:85)
    at init.attach_doc_and_docfields (layout.js:325)
    at init.refresh (layout.js:223)
    at GridRowForm.render (grid_row_form.js:24)

If I understand correctly, you have a table in a table in a table? You can’t do that and that’s why you’re getting this error.
Nested table aren’t supported yet.

Hmmm … that’s not exactly what I wanted to achieve.

I have doctype “Dive guide” as a Table Multiselect field inside the doctype “Itinerary” - the doctype “Itinerary” is set as a table inside the Event doctype. This is the exact formula…

To better understand, inside the table in Event doctype, the “Add row” button doesn’t work neither… hence the error in the console.

Correction for the scenario:

Doctype 1 - Dive guide name
Doctype 2 - Dive guide ( child doctype )
Doctype 3 - Itinerary

“Dive guide name” is put in “Dive guide” as a link field. “Dive guide” is put in “Itinerary” as Table Multiselect. “Itinerary” is put in Event doctype as table.

At some times, Editing the itinerary table in the Event doctype works but after saving the event and refreshing the page, the same errors in the browser console appear.

Guys, I must insist on this subject because it is a very important feature for us.

Any input will be very much appreciated … is this format of doctypes impossible or is it a bug ?

What did you put in the “Options” of the Multiselect?

Hey Nahuel, thank you for the reply.

The name of the “Dive guide” doctype because that’s the link I need.

Is it correctly spelled (the name of the “Dive guide” doctype)? The error is caused because meta is undefined in this code:

const meta = frappe.get_meta(this.df.options);
this._link_field = meta.fields.find(df => df.fieldtype === 'Link');

You should try the next solutions:
A) Put a hidden link field to the “Dive guide” doctype in your doctype
And, if that does not work,
B) Put a link field in the “Dive guide” doctype to the multiselect doctype (the one that has the multiselect)

I don’t know how the multiselect works and never saw it in use, but, from the code, i can tell that the error is there because your “Dive guide” doctype is not in the locals from frappe, i think that the A solution should put it there.

1 Like

i have also same issue in child table it shows as “undefined field”

Thank you so much for taking the time to look into this… it means a lot.

For the solution, the “Dive guide” doctype has at this moment only one Link field point towards “Dive guide name”

I will try to add another hidden link as you said … trying it out both A and B options.

I can imagine the Table Multiselect is a new feature and it can have a bug the same as I discovered the one in Auto Repeat a few weeks ago… but it’s such an important feature haha

1 Like

@Nahuel_Nso sorry to inform that your A and B solutions, sadly do not work.

The error is the same in the browser console.

To make things even more clear, here are the screenshots of the doctypes:

Doctype 1 = Dive guide name

Doctype 2 = Dive guide

Doctype 3 = Itinerary

Eventually the Itinerary doctype is added in the Event doctype like this:

NOTE: The Event doctype is edited using Customise option.

Can anyone help to take a look at this before I must pay someone to fix this bug ? It’s holding us back from other developments.

Pretty please :slight_smile:

Can’t let this get buried, it’s too important.

Help please :slight_smile:

Link to error report Table Multiselect - TypeError: undefined is not an object (evaluating 'e.fields') · Issue #19040 · frappe/erpnext · GitHub

I am still unable to use the Table Multiselect field …

Anyone has any idea please ? :slight_smile:

The bug still blocks us from using the table multiselect field.

We’ve hired a developer experienced with erpnext / frappe - getting close but still not fixed yet.