Try ERPNext Buy Support Partners Foundation

How to add a row to a child table while loading a document?

Hi,
I am trying to Add a Company by default into my Item Default table. Because while trying to add an item in an invoice, it is prompting me to add Company. I tried adding Default value for the field. But it is still asking me to add value into it. So, when I checked I could see that I had to click “Add Row”. It is not convenient to go to the item default table and add company every time to add an item in an invoice. Therefore, right now I have two solutions in mind:

  1. Remove the mandatory option for Company. (This is ok only If my accounts won’t be affected or any other significant issue is not created)
  2. Add a custom script that adds a row dynamically while loading the invoice page. In which case, I need help or any reference in creating the custom script.