How to set custom select Options?

Hello all,
I’m a new developer in frappe framework.
So I want add custom value in child table "Select field " by by .js file.
I can set data field value but can’t set select field value.

Please help anyone.

What are your trying to do? If you share your code we can help. Also specify which version you are using.

Thanks for your replay

I’m using Frappe 4.11.2

Blow is my code

question:function(doc, doctype, docname){
		var local = locals[doctype][docname];
		frappe.call({
			"method": "frappe.client.get",
            args: {
                doctype: "Job Application Question",
                name: local.question
            },
            callback: function (data) {
            	local.question_name=data.message.question;
            	refresh_field("question_name",local.name, "question_answer");
            	if (data.message.question_type=='Text') {
            		
            		// I want to Show answer field and Hide option field Hide for this I used blow code but doesn't work properly.
            		cur_frm.fields_dict["question_answer"].grid.set_column_disp("answer", "hidden", false);
            		cur_frm.fields_dict["question_answer"].grid.set_column_disp("option", "hidden", true);


            	}else if(data.message.question_type=='MCQ') {

            		// I want to Show option field and set option field's Options.
            		cur_frm.fields_dict["question_answer"].grid.set_column_disp("option", "hidden", false);

            		var OptionsList = data.message.mcq_options.split("\n");
            		/*How can I set This OptionList array in option field's Options*/

            	};
            }
		});
	}

Note: 1. How to hide and show field in child table
2. Set Custom Options in select field “option” from “var OptionsList”

Is it possible to set options for a select dropdown within a child table?

Has anyone been able to achieve this? (the dropdown selection list)

There is no set_df_property that i can find to change options for a grid.

Thanks to Enable or Disable a Child Table Field - #13 by ruchin78

You can use this:

frappe.utils.filter_dict(cur_frm.fields_dict[“accounts”].grid.docfields, {“fieldname”: “tax_code”})[0].options = “option 1\noption 2”;

1 Like