This is possible?

Hello.
Is possible to manipulate items from a list using another list?
Example:
List “A” = [“1”, “2”, “3”]
List “B” = [“1”, “2”, “3”]

I select item “1” of B list
Then list A automatically select item “1” too

To use a list you need to use an index to select the value you want.You can simply use the same index for both list.

Yeah, like if list A = [1] then list B = [1]
But i don’t know which function do this in custom script

Well, seems to be that one of us get confuse.

Here you are talking about index

But here you are talking about copy or duplicating the list.

Where do you need to use this? Tell me to figure it out a solution

My problem: Configure Button - #3 by Leonardo_Augusto

So… i will hide the master list, and create another list with some values.
Depending of the my custom list value, this will change the value of the master list.
So i will use the master list indirectly…

Considering you are naming list a child table. In this case, basically you will have two identical child table. When you change a value in a child table you can get the row being edited and update the same row in the second table.

How can i do that?
And why are this a child table if its select field?

Ok my bad… Just use this

frappe.ui.form.on("Doctype Name", "docfield_name",
    function(frm) {
        // here you can get the value selected in the select field and set the value to the hidden select
   }
);

https://frappe.github.io/frappe/user/en/tutorial/form-client-scripting

I’ll try that, thanks :smiley:

I tried this:

if (tipo_de_requisicao == “Purchase”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Purchase”);
}
else if (tipo_de_requisicao == “Locação”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Purchase”);
}
else if (tipo_de_requisicao == “Material Transfer”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Material Transfer”);
}
else if (tipo_de_requisicao == “Material Issue”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Material Issue”);
}
else if (tipo_de_requisicao == “Manufacture”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Manufacture”);
}
else {
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “”);
}

I tried this too:

if (cur_frm.tipo_de_requisicao == “Purchase”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Purchase”);
}
else if (cur_frm.tipo_de_requisicao == “Locação”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Purchase”);
}
else if (cur_frm.tipo_de_requisicao == “Material Transfer”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Material Transfer”);
}
else if (cur_frm.tipo_de_requisicao == “Material Issue”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Material Issue”);
}
else if (cur_frm.tipo_de_requisicao == “Manufacture”){
frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “Manufacture”);
}
else {
cur_frm.frappe.model.set_value(frm.doctype, frm.docname, “material_request_type”, “”);
}