Sunday, February 17, 2013

How to execute inter company transactions using X++


When posting intercompany transactions there are different indications on the table level that indicate the record is an intercompany order.  For example the field purchTable.interCompanyOriginalSalesId will be populated with the relating sales order number and the interCompanyCompanyId will hold the company in which the transaction orginated from

void postProformaPickListInterCompany()
{
SalesFormLetter SalesFormLetter;
SalesTable      findSalesTable;
SalesId         salesIdHolder;
str                company;
PurchTable      purchTable;
;
salesIdHolder = salestable.SalesId;
select firstonly purchTable where purchTable.InterCompanyOriginalSalesId ==     salesIdHolder;
company = purchTable.InterCompanyCompanyId;
changecompany(company)
{
select firstonly findSalesTable index hint salesIdx where findSalesTable.InterCompanyOriginalSalesId == salesIdHolder;
if(findSalesTable)
{
SalesFormLetter = salesFormLetter::construct(documentStatus::PickingList);
salesFormLetter.update(findSalesTable,
systemdateget(),
SalesUpdate::All,
AccountOrder::None,
NoYes::Yes,
NoYes::Yes,
NoYes::No,
NoYes::No,
connull(),
”);

}
}

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...