Using the dimension values getting default dimension recid:
Example 1.
static void dimension(Args _args)
{
DefaultDimensionView defaultDimensionView,defaultDimensionView1;
VendInvoiceTrans vendInvoiceTrans;
while select defaultDimensionView join vendInvoiceTrans
where vendInvoiceTrans.DefaultDimension == defaultDimensionView.DefaultDimension
&& defaultDimensionView.name == "CostCode"
&& defaultDimensionView.DisplayValue == "DX001"
join defaultDimensionView1
where defaultDimensionView1.DefaultDimension == vendInvoiceTrans.DefaultDimension
&& defaultDimensionView1.Name == "Project"
&& defaultDimensionView1.DisplayValue == "TIPL-000044"
{
info(strfmt("%1 %2 ",defaultDimensionView.DisplayValue,vendInvoiceTrans.InvoiceId));
}
}
=============
Using Defult dimension getting Dimension values: Example 1:
ProjTable ProjTable;
DimensionAttributeValueSet DimensionAttributeValueSet;
DimensionAttributeValueSetItem DimensionAttributeValueSetItem;
DimensionAttributeValue DimensionAttributeValue;
DimensionAttribute DimensionAttribute;
while select * from ProjTable
where ProjTable.ProjId == "70001" // To get 70001 dimension values
join RecId from DimensionAttributeValueSet
where DimensionAttributeValueSet.RecId == ProjTable.DefaultDimension
join RecId, DisplayValue from DimensionAttributeValueSetItem
where DimensionAttributeValueSetItem.DimensionAttributeValueSet == DimensionAttributeValueSet.RecId
join RecId from DimensionAttributeValue
where DimensionAttributeValue.RecId == DimensionAttributeValueSetItem.DimensionAttributeValue
join RecId, Name from DimensionAttribute
where DimensionAttribute.RecId == DimensionAttributeValue.DimensionAttribute
{
info(DimensionAttribute.Name+"----"+ DimensionAttributeValueSetItem.DisplayValue);
}
===============
DimensionAttributeValueSetStorage dimStorage;
ProjTable ProjTable;
Counter i;
ProjTable = ProjTable::find("70001"); // To get 70001 dimension values
dimStorage = DimensionAttributeValueSetStorage::find(ProjTable.DefaultDimension);
for (i=1 ; i<= dimStorage.elements() ; i++)
{
info(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name +"----" +dimStorage.getDisplayValueByIndex(i));
}
=============
ProjTable ProjTable;
Counter i;
container conDim;
ProjTable = ProjTable::find("70001"); // To get the dimension values for 70001
conDim = AxdDimensionUtil::getDimensionAttributeValueSetValue(ProjTable.DefaultDimension);
for (i=1 ; i<= conLen(conDim) ; i++)
{
info(conPeek(conDim,i));
}
This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
Subscribe to:
Post Comments (Atom)
Ledger Voucher creation Framework and x++ code to create ledger voucher
Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...
-
Please click here to access Custom Workflow step by step process:
-
FormRun formRun = sender.formRun(); Object inventTrans_ds = formRun.dataSource(formDataSourceStr(InventMarking,InventTransO...
No comments:
Post a Comment
Give me the commetns and solutions