ERPNext query : Customizing form fields

Hi! I wanted to customize sales invoice form according to my needs. I have added 2 more entries in the Customer doc (TIN and ECC no). I want to show the same on sales invoice such that the data is automatically fetched when I select a particular customer.
Needless to say, I am new here :wink:
Thanks for your help!

You can use add_fetch(link_fieldname, source_fieldname, target_fieldname)
Create the same fields on your Sales Invoices doctype then create a custom script like this (supposing your fields are named tin and ecc):


Thanks for your reply. As per your suggestion, I have added the custom script. However, I am unable to see them in the sales invoice form.
I think I should add custom field in the form but what should be its type? If its link, what should be in the ‘Options’ field?
Also, my main motive is to print those two values in the sales invoice. Hence in print formart, I should be able to access those values by typing doc.ecc_no

You can choose type “data” or “link”, both work.
They will be printed if you don’t tick the “print hide” option in the custom field.

1 Like

Thanks a lot :smile:
data type worked.