8 Ağustos 2014 Cuma

AX 2012 - CIL Error 351

Sometimes you can get this error:

Description: CIL generation: The given key was not present in the dictionary.

Path: \XppIL

Line: 1

Method/Property: XppIL

Error: Err:351

Sync DataDictionary and remove all errors at AOT.
Down AOS. Delete all files from this directory except subfolders:

C:\Program Files\Microsoft Dynamics AX\60\Server\AX2012R2_Dev\bin\XppIL

5 Ağustos 2014 Salı

AX 2012 - Add defaultdimension control to form

You can look for LedgerJournalTable form for how to do.
Add a relation with DimensionAttributeValueSet table's RecId  field for which field added from DimensionDefault EDT.

Add a tab page named tabFinancialDimensions and change properties like below:

AutoDeclaration = true
caption = @SYS101181
HideIfEmpty = No
NeedPermission = Manual

Add this line to forms classDeclaration method:

DimensionDefaultingController       dimensionDefaultingController;

Add this code part to forms init method:

public void init()
{

   boolean allowEdit = true;
    super();
    dimensionDefaultingController = DimensionDefaultingController::constructInTabWithValues(false, true, allowEdit, 0, this, tabFinancialDimensions, "@SYS101181");
    dimensionDefaultingController.parmAttributeValueSetDataSource(MyTable_ds, fieldStr(MyTable, DefaultDimension));
    dimensionDefaultingController.parmValidateBlockedForManualEntry(true);
}


Add this method to tab page:

public void pageActivated()
{
    dimensionDefaultingController.pageActivated();
    super();
}


Update table data source methods like below:

public void delete()
{
    super();
    DimensionDefaultingController.deleted();
}

public void write()
{
    ttsBegin;
    DimensionDefaultingController.writing();
    super();
    ttsCommit;
}

public int active()
{
    int ret;

    ret = super();
    DimensionDefaultingController.activated();
    return ret;
}


4 Ağustos 2014 Pazartesi

AX 2012 - SSRS How to suppress zero as blank?

Put this instead of put field (At this time PurchPrice) itself:

=IIF(Fields!PurchPrice.Value = 0 ,"",Fields!PurchPrice.Value)