I was creating a custom field table in Customer form. When I set this custom field table to “Item” (in option box) and saved. Then I went to customer form and tried to add an item (clicked the “+ Add new row”) but it crashed back to home screen (modules). It worked if I set the table field to “Sales Invoice Item” or “Sales Order Item”, but not “Item”. I would like to create a table list of items what a customer has (customer assets). Am I not allowed to use Item in this case?
Also other related fields don’t populated automatically after I select an item in the item code field. In this case I use built-in sales order item doctype in the custom field table. Do I have to do something else to make this work?
The correct design is that you will have to create a new DocType “Customer Asset” and have Item as a linked filed in the Customer Asset table. Then make the Customer Asset as a child table to Customer
OK, I have created a new Customer Asset DocType as a child table with two fields, one Item Code (link) and one Item Name (Data). I added this new Customer Asset as a table in Customer form with “Customer Asset” in the options box. Now I can type in the Item Code field and it pulls up item code info. It works but the Item Name field is still not being populated automatically, just staying empty. How do I make auto population working based on Item Code?
Add a simple
Custom Script for Customer doctype.
cur_frm.add_fetch('item_code', 'item_name', 'item_name');
It’s working, thanks! Look like this can be done by GUI without coding. Hope this will be added in future version. One day a monkey can use ERPNext
The feature is there, but only works if
Item Name field is non-editable in Customer Asset table. In that case if you write
Options for the field “Item_name” field, it will be auto-fetched. You can do that from Setup -> Customize Form.