I have added a custom field of type real 'No of months' to SalesLine table and when any value is put in, the Net amount is calculated as unit pricequantityNoofmonths. This works fine i.e net amount(line amount) is calculated when the field No of months is filled. when the sales order is confirmed and invoice is posted, the old net amount i.e the one which system automatically calculated without the custom field is shown which means line amount is again calculated after confirmation or invoice posting.
For the solution, I have added the field to tables "SalesLine", "CustInvoiceTrans", CustInvoiceJour and added the field in table extensions of these tables.The screenshot is attached


