Limit items based on customer name

Hi

Is it possible to limit item list based on customer when we want to do a purchase order?

This means when we select the customer, only the allowed items are allowed to show in the child table.

I have read the following:

But is it possible to do this without touching ERPNext and Frappe backend code?
Thanks!

Regards

Maybe the below steps might help you

  1. Create a Custom Doc Type, which holds a mapping of Customer to Item Codes.

  2. Add a link field for Item on the pages where you want this. Assuming these pages would have Customer ID as well.

  3. Write custom JS using frappe.ui.form.on along with filters to do this.

Thanks

1 Like

Hi @Pawan

Thank you very much for the prompt response!

Will try and feedback if it works.

Thanks!

Regards

Mulyadi

Hello Mulyadi, yes Pawan’s reply is spot on, I did create a custom Doc type, with a mapping, My code will fetch customer profile when I select the customer in the order module.in my case it is 1 to many profiles relationship so it had to be a table with a link to the customer.

1 Like

Hello @CoffeeHolic!

Thank you for the details! Appreciate it!