How to get select options from another DocType's field in tabSingle

In tabSingle (ie. Is Single DocType) I would like to provide a Select field whose select options should be options added in Purchase Invoice Doctype’s naming_series field. How can I achieve that?

@lekhnath . use a custom script on refresh. get the option from the doctype invoice. and insert them in your “select” field . frm.set_df_property(“field”, “options", [“1”,“2”]);

Thanks. I’ll give that a try.

frappe.ui.form.on('My Custom Settings', {

onload: function() {

        frappe.model.with_doctype('Purchase Invoice', () => {
		const meta = frappe.get_meta('Purchase Invoice');

		const naming_series = meta.fields.find(df => df.fieldname === 'naming_series');

		frm.set_df_property('my_custom_settings_selectio_field', 'options', naming_series.options);
	});

},

});