Add new field to pos page from custom app

I want to add a custom filed like Customer to online pos page. I can do this by changing the core point_of_sale.js . But i want to customize it from custom_app.
I was successfully extend point_of_sale.js at my custom js by changing in hooks.py

page_js = {“point-of-sale” : “public/js/point_of_sale.js”}

My point_of_sale.js code so far

try {
// offline
erpnext.pos.PointOfSale = erpnext.pos.PointOfSale.extend({})
}catch (e){
// online
class PointOfSale extends erpnext.pos.PointOfSale {
constructor(wrapper){
super(wrapper);
this.custom_func();
}
custom_func(){
//alert(“Custom function”);
var div_customer_field = this.wrapper.find(“.customer-field”);
var sales_invoice_id_html = <div class="sales-invoice-field"> <input type="text" class="input-with-feedback form-control bold" data-fieldtype="Link" placeholder="" data-target="Customer" autocomplete="off" aria-owns="awesomplete_list_32" role="combobox" aria-activedescendant="awesomplete_list_32_item_0"> </div>
div_customer_field.after(sales_invoice_id_html);
div_customer_field.css( “background-color”, “blue” );
//debugger
}
But nothing happend. If i try this code from console pannel then code was working.
can anoyone guide me or give a example to add new field to pos page from custom app?

1 Like

Hi @Saidul_Islam , were you able to fix your issue eventually?