This is what I came up with. But there’s one issue, it is printing twice in console.
frappe.pages['customer'].on_page_load = function(wrapper) {
var page = frappe.ui.make_app_page({
parent: wrapper,
title: 'Customer',
single_column: true
});
frappe.show_alert('Hey '+frappe.session.user,3)
page.custom_field = page.add_field({
fieldname: 'customer',
label: __('Customer'),
fieldtype: 'Link',
options: 'Customer',
change: function(){
console.log('first time')
}
});
}
Can anyone help/suggest why it is printing twice.
Also I tried with refresh event but that also is doing the same