Hello experts,
can any 1 hlp me out,
I want to link inventsettlement table with main account table in ax 2012
I have used the follwing code.
/* main
[
SysEntryPointAttribute(false)
]
public void processReport()
{
SintoPInventAdjustcontract Contract;
Contract = this.parmDataContract() as SintoPInventAdjustcontract;
voucher=Contract.Parmvoucher();
// mainAccountNum=Contract.ParmMainAccountNum();
if(voucher!="")
{
while select * from inventSettlement
join inventTransOrigin
order by inventSettlement.ItemId
where inventSettlement.Voucher == voucher
// && inventSettlement.OperationsLedgerDimension==dimensionAttributeValueCombination.RecId
&& inventTransOrigin.InventTransId == inventSettlement.InventTransId
{
this.insert(InventSettlement);
}
}
/*insert
private void Insert(InventSettlement ObjInventSettlement)
{
select * from dimensionAttributeValueSetItem
join dimensionattribute
join DimensionAttributeValue
join dimensionAttributeValueCombination
join MainAccount
where dimensionattribute.RecId == DimensionAttributeValue.DimensionAttribute &&
DimensionAttributeValue.RecId == dimensionAttributeValueSetItem.DimensionAttributeValue &&
dimensionAttributeValueSetItem.DimensionAttributeValueSet == ObjInventSettlement.DefaultDimension &&
dimensionAttributeValueCombination.RecId == ObjInventSettlement.OperationsLedgerDimension
&& dimensionattribute.Name == "Project";
{
// if(dimensionattribute.Name == "Project")
{
// select * from ProjTable
//where ProjTable.ProjId == dimensionAttributeValueSetItem.DisplayValue;
sintoinventsumtmp.Project = dimensionAttributeValueSetItem.DisplayValue;
//sintoinventsumtmp.LedgerAccount =ObjInventSettlement.OperationsLedgerDimension;
}
}
// select * from inventTransOrigin
// join ObjInventSettlement
// where inventTransOrigin.InventTransId ==ObjInventSettlement.InventTransId;
sintoinventsumtmp.VoucherNo=ObjInventSettlement.Voucher;
sintoinventsumtmp.Date=ObjInventSettlement.TransDate;
// sintoPInventoryTmp.ItemId=ledgerjournaltran
sintoinventsumtmp.BasicValueAmount=ObjInventSettlement.CostAmountAdjustment;
sintoinventsumtmp.ItemId=ObjInventSettlement.ItemId;
sintoinventsumtmp.ReferenceId=inventTransOrigin.ReferenceId;
//sintoinventsumtmp.LedgerAccount =
sintoinventsumtmp.LedgerAccount=generalJournalAccountEntry.LedgerAccount;
// sintoPInventoryTmp.ItemId=inventSettlement.ItemId;
sintoinventsumtmp.Insert();
}
Because i want to display GL code in the report .
Regards,
Pradeep
Hi pradeep M B,
Inventory transactions are summarizes in the GL vouchers.
Why is it that you are looking out for this linkage?
What do you try to achieve ultimately?
Best regards,
Ludwig
Sir Can u write the code and send me plses
regards,
pradeep
If you look at relations on inventSettlement table, that will give you desired information.
the DIMENSIONATTRIBUTEVALUECOMBINATION table provides you the main account in DisplayValue.
See AOT relations (screenshot from D365FO but you should similar in AX2012 as well).
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156