I am customizing the sales invoice report in AX 2012. I want to display the invent site address instead of Company address in salesinvoice report. The site addresses are stored in Logistics postal Address table. I create a new salesorder and give the site and warehouse. these site address are displayed in Company Address. Pls help me how to write the business logic of this customisation.
If the site address is stored in the Logistics Postal Address Table, then do the following things:
Enter a new field into SalesInvoiceTmp table. (This is the table where the data gets filled and this table in turns fills the dataset for the report).
Then in the class SalesInvoiceDP, inside the method insertIntoSalesinvoiceTmp, write the following code
SalesInvoiceTmp.NewField = LosicticsPostalAddress.Address.
Refresh the datset and you would see a new field.
Drag this field into the designer finally at the appropriate place.
Hope it helps.
How to link between the Invent site Table and Logistics Postal Address.
All fields are coming from CustinvoiceJour table
1.The InventSite Table RecId and LogisticsLocation Table Recid are stored in InventSiteLogisticsLocation(siteId,LocationId these two fields are Ref Fields In this table)
- How to use this Ref fields and display the Address.
(siteId) (InventLocationId) (RefsiteId,RefLocationId) (LocationId) (RefLocationId,Address)
How to write a select query for Address
I am confused with this logic.We can select different site for each Item id for one sales order.In this way what Address you will print in sales order invoice.If it is right please excuse!
Check below path.
SalesInvoiceTmp.NewField = LogisticsPostalAddress::findByLocationAndValidDateTime_IN(Inventsite::find(your site id),invdate,invdate).address
Use datetobeginUtcDateTime(),datetoendUtcDateTime for converting date to datetime.
Hope this will solve your problem.
We select Diff sites for different salesorders. These site addresses are printed in SalesInvoice Report Header(instead of Company Address).
In LogisticspostalAddress, FindByLocationAndValidDaterTime_IN method is not there.
Please give me a suggestion, It is very urgent Requirement.
I used view LogisticsEntityPostalAddressView.
inventSite = purchLine.inventDim().InventSite();
select firstOnly siteAddress
where siteAddress.EntityType == LogisticsLocationEntityType::Site
&& siteAddress.Entity == inventSite.RecId;
Late but it might help the next person…