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
Thanks for your help!
Hi!
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
):
cur_frm.add_fetch('customer','tin','tin');
cur_frm.add_fetch('customer','ecc','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.
Thanks a lot
data type worked.