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:
Hi Pawan, thanks for the reply. I think you are referencing “add_fetch” if I am not mistaken. Does add_fetch work for table type link, in Customer? have you used add_fetch for fetching data to populate a table? I would appreciate it Thanks
But is it possible to do this without touching ERPNext and Frappe backend code?
Maybe the below steps might help you
Create a Custom Doc Type, which holds a mapping of Customer to Item Codes.
Add a link field for Item on the pages where you want this. Assuming these pages would have Customer ID as well.
Write custom JS using frappe.ui.form.on along with filters to do this.
Thank you very much for the prompt response!
Will try and feedback if it works.
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.
Thank you for the details! Appreciate it!