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, Thanks for your suggestion. Can you please let me know in which method should i write the code for transaction to be updated in a New Customized form Sales Details. the attached screenshot is the new form which is updated every time a sales Invoice is posted against a Sales Order. I need to have the fields encircled in Red. I am not able to fetch the fields from TaxTrans_IN table. I am not getting the method where in i should write the code for auto update with all the necessary fields. Please help. Thank You.
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.
Go to find the class named SalesFormLetter_Invoice in AOT which will be runed when posting a Sales Inovice. You can also debug the class with adding break point in main mehtod;
Thanks for the reply . I wrote the code in this class but here only the last line present in the Invoice is updated, it means if a sales invoice has 4 parts shipped, only last line will be updated with the Invoice amount. I want the transaction to be updated line by line. can you please tell me where should i write the code for line by line update of transactions . Thank you.
can you show me where and how you add code?