I need to know where should i write a code to Auto-Update Sales Invoice Transactions posted against a Sales Order. My requirement is whenever a Sales Invoice is posted with 'n' number of lines, a form should be Auto- Updated having the Sales Invoice Transaction Fields from Tables CustInvoiceTrans,TaxTrans_IN. I have written the code in CustInvoiceTrans Insert method, but i am not able to get some of the fields in the Form. Am i writing the code in wrong method? The encircled fields are present in TaxTrans_IN table but i am not able to get them in insert method of CustInvoiceTrans Table. Attached screenshot for your reference. Please suggest. Thank You.
Senthily said:I need to know where should i write a code to Auto-Update Sales Invoice Transactions posted against a Sales Order.
So did you added custom fields to CustInvoiceTrans table? If so from where do you want to get the field values?
(or) do you just want to show the fields from TaxTrans_IN on CustInvoice transactions forms? Please explain it clearly.
I have created a new form as attached in above screenshot where in the sales invoice transaction are posted automatically. I need some of the fields to be fetched from TaxTrans_IN table and displayed on this form I have written the code in insert method of CustInvoiceTrans Table for auto update of sales transaction in this form.
If the records are inserted into TaxTrans_IN after inserting the records into CustInvoiceTrans, then your approach will not work.
Try debugging and check when the records are inserted into TaxTrans_IN (add break point to insert method).
Yes thanks for the information. any other option can you suggest to update the form. I checked TaxTrans_IN is updated post record inserted into CustInvoicTrans. Please let me know any other solution if you have. Thank You.
You can use TaxTrans_IN as one of the data source in the invoice form and use directly the fields from TaxTrans_IN (without adding and updating the fields on CustInvoicTrans table)
update the CustInvoicTrans fields after the records are inserted into TaxTrans_IN
Hello Kranthi, i used TaxTrans_IN as one of the datasource in Sales Details Form but the fields are displayed as Zero. can you please let me know where i am going wrong,. Thank You.
How did you joined TaxTrans_IN?
Hello Kranthi, I joined it using innor join on form, but the results are not as per requirement.
Attached screenshot for you reference. Kindly Suggest if we could get it from some query or method from TaxTrans_IN table.
There can be multiple TaxTrans_IN per an invoice transaction. How would you handle that?
Is SalesDetails a custom table? If so when the records are inserted into that table?
Yes SalesDetails is a Customized Table where in the transaction are inserted while invoice posting transaction. I have written the code in class named SalesFormLetter_Invoice. I want just the TaxAmount being posted against the Lines present in each Invoice from TaxTrans_IN table.