Alfasith AX

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

Tuesday, September 30, 2014

Set handling in AX

Hi,

static void AlfasithSet(Args _args)
{
Set set = new Set(Types::String);
;
set.add("Alfasith");
set.add("Dynamic");
set.add("AX");
print set.toString(); //{"Alfasith", "Dynamic","AX"}
print set.elements(); //3
print set.in("ERP");    //it return false because EPR is not there in that set
print set.in("AX");    //it return true AX is present in that set
pause;
}
//Duplicate value insertion will not be considered...
to iterate that inserted values.

    InventJournalTrans       inventJournalTrans;
    SetIterator iterator;
    ;
    iterator = new SetIterator(allocationRecIDs);
    while (iterator.more())
    {
        select forupdate inventJournalTrans where inventJournalTrans.JournalId == iterator.value();
        inventJournalTrans.MiscCharges = markupValue;
        inventJournalTrans.update();
        iterator.next();
    }

Regards,

Main account and dimension relation in AX


Hi,

static void AlfasithMainAccDimRel(Args _args)

{
    MainAccount     mainAccount;
    DimensionAttributeValueCombination  dimensionAttributeValueCombination;

    select mainAccount where mainAccount.MainAccountId == "140250"
                        &&  mainAccount.LedgerChartOfAccounts == LedgerChartOfAccounts::current();

     select dimensionAttributeValueCombination where dimensionAttributeValueCombination.MainAccount == mainAccount.RecId;
    print dimensionAttributeValueCombination.RecId ;

    pause;
}

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...