29 Eylül 2014 Pazartesi

AX 2012 - R3 Installation

In first check  minimum system requirements . MS-SQL collate doesn't installed as turkish. With turkish like SAP and Oracle you'll have problems about "i" letter of turkish, after AX 2012 install, at database sync, installation will fail.
I used Dilip's Blog for installation instead of Microsoft's long and complex white paper. Installation of AX 2012 is so easy of it's mine change. :)

In first Active Directory should be installed. There are plenty of pages about AD installation at Google.

I just used basic AX 2012 like Dilip's, let SSRS etc. installation later. AX 2012 setup gives prerequisities links and configures some of prerequisities automatically. I didn't faced any problem at installation.

After installation I upload demo data again from a  blog page . Demo installation was harder than AX 2012 installation.

I installed SQL Server SSRS add-in and configured look from a blog . Anyway for developing SSRS reports (Doesn't require for deploy) don't forget install Business Intelligence Development Studio from SQL Server Setup. SSRS configure was so easy; in order run Service account, Web service URL, Database, Report Manager URL tabs with defaults was enough.

Again I used  another Dilip page for SSRS install. I haven't got any trouble and didn't need Dilip's manual complete way for install, reports deployed smootly. :)

26 Eylül 2014 Cuma

AX 2012 - If batch jobs cannot start?

If you look up Home->Inquiries->Batch jobs->My batch jobs and see batch jobs don't start.

Go System administration->Setup->System->Server configuration and check there is a record at Batch server schedule with proper time gap (00:00 -23:59) and be careful about Maximum batch threads value bigger than zero.

Also problem maybe about there is no attached server to batch group :
Administration -> setup -> Batch Groups
Find empty batch group and go Batch Servers tab, look for Selected server field has correct server value.

15 Eylül 2014 Pazartesi

AX 2012 - Create a new financial dimension which related a table(s)

I found the easy way that the way from a blog which referred Microsoft'un related white paper:

1-Duplicate one of views from AOT which beginned DimAttribute and new views name should be begin same DimAttribute word.
2. Main datasource name should be BackingEntity unrelated what name used with original table name.
3. All field names of view should be like these whatever original names:
Key - data source tables Surrogate key field. Like RecId...
Value - data source tables primary key . Like AccountNum...
Name - Description field. Like Description or CustomerName...

There are two ways to use this new dimension implementation:

AOS restart

or

DimensionCache::clearAllScopes(); 

command.

11 Eylül 2014 Perşembe

AX 2012 - Get an individual dimension value from a LedgerDimension value

I used a data model about ledger dimension from a blog when I create this page. Unfortunately I couldn't understand code written at that blog and wrote this code:


 DimensionDefault                        d =  5637183219;
    DimensionAttributeValueCombination      dimensionAttributeValueCombination;
    DimensionAttributeValueGroupCombination dimensionAttributeValueGroupCombination;
    DimensionAttributeValueGroup            dimensionAttributeValueGroup;
    DimensionAttributeLevelValue            dimensionAttributeLevelValue;
    DimensionAttributeValue                 dimensionAttributeValue;
    DimensionAttribute                      dimensionAttribute;
   
    select dimensionAttributeValueCombination
            where dimensionAttributeValueCombination.RecId == d
        join dimensionAttributeValueGroupCombination
            where dimensionAttributeValueGroupCombination.DimensionAttributeValueCombination ==
                  dimensionAttributeValueCombination.RecId
        join dimensionAttributeValueGroup
            where dimensionAttributeValueGroup.RecId == dimensionAttributeValueGroupCombination.DimensionAttributeValueGroup
        join dimensionAttributeLevelValue
            where dimensionAttributeLevelValue.DimensionAttributeValueGroup == dimensionAttributeValueGroup.RecId
        join dimensionAttributeValue
            where dimensionAttributeValue.RecId == dimensionAttributeLevelValue.DimensionAttributeValue
        join dimensionAttribute
            where dimensionAttribute.RecId == dimensionAttributeValue.DimensionAttribute &&
                  DimensionAttribute.Name == "Project";
    info(DimensionAttributeLevelValue.DisplayValue);


Update:
The code at up doesn't worked for PurchTable defaultDimension field.
I got this code from Andesoft'un web site :

 DimensionDefault                        d =  5637169331;
    DimensionAttributeValueSet  dimAttrValueSet;
    DimensionAttributeValueSetItem  dimAttrValueSetItem;
    DimensionAttributeValue         dimAttrValue;
    DimensionAttribute          dimAttr;
    Common      dimensionValueEntity;
    DimensionValue  dimensionValue;
    DimensionAliasName  dimensionName;
   
    dimAttrValueSet = DimensionAttributeValueSet::find(D);
    while select dimAttrValueSetItem
        where dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId
    {
        dimAttrValue = DimensionAttributeValue::find(dimAttrValueSetItem.DimensionAttributeValue);
       
        dimAttr = DimensionAttribute::find(DimAttrValue.DimensionAttribute);
        dimensionvalueentity = DimensionDefaultingControllerBase::findBackingEntityInstance(
        curext(),DimAttr,dimAttrvalue.EntityInstance);
        dimensionvalue = dimattrvalue.getValue();
        info(strFmt("%1 %2",Dimensionvalue, DimAttr.Name));
    }


10 Eylül 2014 Çarşamba

AX 2012 - Get an individual dimension value from a DefaultDimension

I used another blogs code when writing this code:

   DimensionAttributeValueSetStorage  dimStorage; 
   Counter               i; 
   DimensionAttribute         dimAttributeCostCenter; 
   DimensionAttributeValue       dimAttributeValue; 
   DimensionDefault         d =  5637168596;
   
   
   dimStorage = DimensionAttributeValueSetStorage::find(d); 
   info(dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName("Project").RecId));   
   

AX 2012 - Add a new dimension value to Default dimension

I wrote this code from one of Eyüp Tezar's code:

DimensionDefault DefDim;
DimensionAttribute                  dimensionAttribute;
DimensionAttributeValue             newValue;
DimensionAttributeValueSetStorage   dimensionStorage;


DefDim = mytable.Defaultdimension;

dimensionAttribute = DimensionAttribute::find(myDimRecid);


newValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute,
        myDimValue,false,true);

dimensionStorage = DimensionAttributeValueSetStorage::find(DefDim);
dimensionStorage.addItem(newValue);

DefDim = dimensionStorage.save();

//------------------- another dimension ------------------------

dimensionAttribute = DimensionAttribute::findbyName("Project");


newValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute,
        myDimValue2,false,true);

dimensionStorage = DimensionAttributeValueSetStorage::find(DefDim);
dimensionStorage.addItem(newValue);

DefDim = dimensionStorage.save();

8 Eylül 2014 Pazartesi

AX 2012 - New taxtrans table structure

Taxtrans table structure changed with AX 2012. There's a good white paper of Microsoft about this. There's a sample join below:


    select generalJournalAccountEntry
            join generalJournalEntry
        where generalJournalEntry.RecId == generalJournalAccountEntry.GeneralJournalEntry &&
              generalJournalEntry.RecId == _RecId
            join subledgerVoucherGeneralJournalEntry
        where subledgerVoucherGeneralJournalEntry.GeneralJournalEntry == generalJournalEntry.RecId
            join dimensionAttributeValueCombination
        where dimensionAttributeValueCombination.RecId == generalJournalAccountEntry.LedgerDimension
            join mainAccount
        where mainAccount.RecId == dimensionAttributeValueCombination.MainAccount;
 




AX 2012 - Where's LedgerTrans?

LedgerTrans gone with AX 2012 and came some new tables. You have to join these tables. There's a good  white paper of Microsoft's about this issue. Some fields renamed and/or moved different tables, all of these explained at this white paper. There's a sample join below:


select generalJournalAccountEntry
            join generalJournalEntry
        where generalJournalEntry.RecId == generalJournalAccountEntry.GeneralJournalEntry &&
              generalJournalEntry.AccountingDate  >=  beginDate && generalJournalEntry.AccountingDate <= endDate
            join subledgerVoucherGeneralJournalEntry
        where subledgerVoucherGeneralJournalEntry.GeneralJournalEntry == generalJournalEntry.RecId
            join dimensionAttributeValueCombination
        where dimensionAttributeValueCombination.RecId == generalJournalAccountEntry.LedgerDimension
        join mainAccount
        where mainAccount.RecId == dimensionAttributeValueCombination.MainAccount &&
              mainAccount.MainAccountId == myAccount

3 Eylül 2014 Çarşamba

AX 2012 - Set voucher to LedgerJournalTrans table

When use AXLedgerJournalTrans class, voucher set as automatically. But if you add record directly to table you have to set voucher:

numberSeq   = numberSeq::newGetVoucherFromCode(NumberSequenceTable::find(ledgerJournalTable.ledgerJournalName().NumberSequenceTable).NumberSequence);
 LedgerJournalTrans.Voucher     = numberSeq.voucher();

2 Eylül 2014 Salı

AX 2012 - Add splitter to form

It's more easy to add splitter control to AX 2012 than 2009. I'll tell horizontal splitter:


Add a group for top part of form. I named it as Hsplitter. Set AutoDeclaration = Yes and  Style = SplitterHorizontalContainer. Add another group for down part of form. Give a name to top group. I named it as TopGroup, also set AutoDeclaration = Yes for this group too. Make bottom groups Height as Column Height. Splitter group should be betwen of other two.

Add this line to form's classDeclaration:

SysFormSplitter_Y                       HorizontalSplitter;

If splitter will be vertical should be SysFormSplitter_X.

Add this line to form's init method:

HorizontalSplitter = new SysFormSplitter_Y(HSplitter,TopGroup, element);

If vertical, should be new SysFormSplitter_X ...

That's all...