ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Is it Possible to Dynamically change Option(s) on a 'Select' field?

frappe.ui.form.on("Senior High Spreadsheets", "semester", function(frm) {
        method: "wela.registration.doctype.senior_high_spreadsheets.senior_high_spreadsheets.get_subjects",
        args: {
            "semester": frm.doc.semester,
			"strand": frm.doc.strand
        callback: function (r) {
        	console.log('HELLO soy');
			var x = r.message["result"]

my x is a list, and I want x to be the values in my "grading_subject field

my Doctype

the Form, in Grading Subject I want x to be the option(s)

Filter for select field type

In your callback

frm.set_df_property('grading_subject', 'options', ['option a', 'option b']);

Set Value in select type field

great! thank you soo much :smiley:


Value is saving in database but when refresh the document value not shown in field?

after save

after refresh



It is working…but by doing so CSS style of drop down has changed…

Its seems like normal drop down…

how to change its style…?

Any help?