Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Wednesday, May 7, 2014

Standard data type & Composite data types in dynami AX

Hi,

DataType

AX - Primitive and composite

primitive:

1) int [32]
2) int 64 - long int [ credit card numbers, debit card numbers]
3) real - decimal points example : 12346.00 [12 digits]
4) str  - sequence of characters [ lengTH - 10]

5) Base Enums: enumerations [ fixed set of constants/literals]

  - constant - will never change

example : week [ sunday 0, m1, t 2, we 3, thu 4, fri 5, sat 6]
 Year [j........d]
gender [ m, f, uk]

enum value starts with 0
Largest value it can hold is 250

6) Date - in order to hold any date values [mm/dd/yyyy], dd/mm/yyyy 20-Aug-2010

7) Time - integer

8) DateTime - 12/23/2011 2:00:05 PM

9) 5.0 version of AX - utcDateTime -  Universal time control data time

example: if you do the transaction @ 6 PM IST - the transactions transaction can be see @ 8:30 AM EST in US.

10) GUID - Global unique identifier - 24 digit hexa decimal number which system will generate automatically

 example : 23hgdh-12321h-12nb23-haifa9


Composite data types:

1) Arrays -  collection of similar datatypes:

1) Index starts with 1

EXAMPLE :

str names[11]; //static array
// dynamic array str names[]
names[1] = "Kabir";
names[2] = "Khan";
;
;
;
names[8] = "Alfasith";


2) Containers :

Large objects[BLOB] - Images, files, pdfs, vidoes etc


Regards,

Code to create general journal in Dynamic AX

Hi,

static void CreateGLJournal(Args _args)
{
    AxLedgerJournalTable journalTable;
    AxLedgerJournalTrans journalTrans;
    DimensionDynamicAccount     offsetDimensions, bankaccount;
    DNIPMIPParameters   parameters;
    dimensionStorage    dimensionStorage;
    LedgerAccountContract   ledgerAccountContract;
    DimensionValue  dimvalue;
    LedgerDimensionAccount dimaccount, ledgeracc;
    LedgerJournalTable  ledgerJournalTable;
    LedgerJournalTrans  ledgerJournalTrans;
    DNIPMPfInvestmentLines  DNIPMPfInvestmentLines;
    DNIPMPfInvesmentTable   table;
   // "??CEU-000025";
    int i;
    ;
    i = 1;
    journalTable = new AxLedgerJournalTable();
    journalTrans = new AxLedgerJournalTrans();


    journalTable.parmJournalName("GenJrn");
    journalTable.save();
    select * from parameters;
    while(i<5)
    {
    journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
    journalTrans.parmTransDate(systemDateGet());
    dimvalue = DimensionStorage::getMainAccountNumFromLedgerDimension(parameters.Payment);
    dimaccount = DimensionStorage::getDefaultAccountForMainAccountNum(dimvalue);
    ledgeracc = DimensionDefaultingService::serviceCreateLedgerDimension(dimaccount);
    journalTrans.parmAccountType(LedgerJournalACType::Ledger);
    journalTrans.parmLedgerDimension(ledgeracc);

    journalTrans.parmAmountCurDebit(2000);
    bankaccount = DimensionStorage::getDynamicAccount('USA OPER', LedgerJournalACType::Bank);
    journalTrans.parmOffsetLedgerDimension(bankaccount);
    journalTrans.parmOffsetAccountType(LedgerJournalACType::Bank );
    journalTrans.parmCurrencyCode("USD");
    //journalTrans.currentRecord().insert();
    journalTrans.save();
    i++;
    }

    info(strFmt("Journal %1 created", journalTable.ledgerJournalTable().JournalNum));

}

Regards,

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...