Return fields of doctype

Hello I’am new at erpnext/frappe

How can I return the fields of doctype selected and put them into select options custom script

dear Hela_Guesmi,

can you elaborate your question?

Thank you for your reply I resolve the problem

@Hela_Guesmi great that you resolved it, generally you should post your solution for the community to benefit.

frappe.ui.form.on('Doctype Name', {

doc_type: function(cur_frm, cdt, cdn) {
   let row = frappe.get_doc(cdt, cdn);		
       if (!row.doc_type) {
		frappe.msgprint(__("Select Document Type."));
    frappe.model.with_doctype(row.doc_type, function() {
	var options = $.map(frappe.get_meta(row.doc_type).fields,
			function(d) {
			if(d.fieldname && frappe.model.no_value_type.indexOf(d.fieldtype)===-1) {
			return d.fieldname;
			return null;
          console.log('test options select field' + options);

          frappe.meta.get_docfield("Doctype Name", "fields", = [""].concat(options);

          frappe.model.set_value(cdt, cdn,"fields", options);