SBX - Search With Button

SBX - Forum Post Title

How to populate a field from sales order header to sales invoice journal overview tab ?

Microsoft Dynamics AX Forum

ShubhAX asked a question on 11 Jan 2019 1:02 AM

Question Status

Verified

Hello experts, I am novice developer in Axapta, i need your help to populate a field from sales order header to sales invoice journal overview tab and this field also need to show on reports.
I am not getting the actual logic where i need to code or add customization. Please specify the object requires to modify to get this functionality. 

Reply
Crispin John Augustine responded on 11 Jan 2019 2:27 AM
My Badges

Have a look at the table method CustInvoiceJour.initFromSalesTable(). Your Code has to go in here to copy from order to invoice.

To get in Report, it is a separate development.

Reply
ShubhAX responded on 15 Jan 2019 2:57 PM

Hi Crispin !

As you directed the method used, i have added my logic to that method as

this.myField = salesTable.myField; ........ Where my field is a NoYes enum type... The value is still not updating according to the sales order header.

Value in sales order header is populating from cust table now i need to show the same value on Cust inovice jour form and then use the same value in report design

Reply
Martin Dráb responded on 15 Jan 2019 3:07 PM

The debugger might help you to debug your code. It's much more reliable than trying to guess what's going on.

But first make sure that your code is compiled and CIL generated.

Reply
Hossein Karimi responded on 15 Jan 2019 11:53 PM
My Badges
Suggested Answer

Hi ShubhAX,

if your field is exist in your DB or you want to save it,fine this field in data source of your form and just Drag and Drop in "journal overview tab".

after doing this, Compile form and Incremental CIL

Reply
Verified Answer

If you want your field to be copied over on invoice journal during invoice process , you can  use class salesInvoiceJournalCreate . Use debugger  while posting invoice to see how custInvoiceJour is created and add your code as per your requirement.

Reply
ShubhAX responded on 16 Jan 2019 4:30 AM

Hi Sukrut,

I have written the logic in SalesInvoiceJournalCreateBase.createJournalHeader()  and the field with values gets shown in the form.

Does it is write place to write the custom code ?

Reply
ShubhAX responded on 16 Jan 2019 4:30 AM

Hi Sukrut,

I have written the logic in class SalesInvoiceJournalCreateBase.createJournalHeader()  and the field with values gets shown in the form.

Does it is write place to write the custom code ?

Reply

It should be fine , as long as you have done your end to end test and everything works.

Reply
Verified Answer

If you want your field to be copied over on invoice journal during invoice process , you can  use class salesInvoiceJournalCreate . Use debugger  while posting invoice to see how custInvoiceJour is created and add your code as per your requirement.

Reply
Hossein Karimi responded on 15 Jan 2019 11:53 PM
My Badges
Suggested Answer

Hi ShubhAX,

if your field is exist in your DB or you want to save it,fine this field in data source of your form and just Drag and Drop in "journal overview tab".

after doing this, Compile form and Incremental CIL

Reply

SBX - Two Col Forum

SBX - Migrated JS