How to set new list for link field without using doctype in custome script

in Screen short showing item code Raw1 Rwa3 so i want to add actual stock quantity like (Raw1(10),Raw3(5)) i don’t know how to set these things can anyone please help me

Can you give an example of your desired result ?

hi
@root13F Actually in sales order i am trying to add stock quantity in item_code row drop down list
for example redmi(05)

please mention your erpnext version

hii

@root13F my ERPNext version is 11

branch develop ?

Let me see if I can come up with something.

However one thing is for sure:-

  1. You will have to write a custom script. Check out examples.
  2. You will need to call a function that will get the actual qty of that item in a certain warehouse you select.

However, the sections below in the items will already be displaying the actual qty of that item. You can always refer to that

actually i have quantity and item code also only i want to set there.
and i am using the code
cur_frm.set_query(“item_code”, “items”, function(frm, cdt, cdn) {
console.log(“Entering labele of item_code-------------”);
var d = locals[cdt][cdn];
var items_data=get_po_data();
console.log(“items_data—”+items_data);
return {
“filters”: [
[“Item”, “name”, “in”, items_data]
]
}
refresh_field(“item_code”);
refresh_field(“items”);
});
Note:
In items_data list, i have items(item_code and stock_qty) like: [Redmi(5),Lenovo(10)]