[SOLVED] How do you assign a value to table multi-select in the client script?

Simply You have to go to Child Table Which You have Given In Options for Tab MultiSelect. Click on Field and Enable Properties In List View, In List Filter and In Filter as shown in image below.
image

and for table multiselect field enable properties
Allow in Quick Entry, In List Filter and In Filter as shown in image below.
image

This Will Solve the Issue. without any script.

To copy values from field use :

frappe.call({
        method: "frappe.client.get",
        args: {
            doctype: "Spray Program",
            name: frm.doc.spray_program,
            async: true
        },
        callback: (rs) => {
            let res = rs.message.sp_crops;
            let crops = []

            for (var index in res) {         
                crops.push(res[index]);
            }

            frm.set_value("user_crops", crops);
            refresh_field('user_crops');
        }
    });
1 Like