22 Temmuz 2015 Çarşamba

20 Temmuz 2015 Pazartesi

AXAPTA - Remove or add invent reservation

You can add or remove reservation with this code which I learned from Volkan Şişman:

InventUpd_Reservation       invUpdReservation; 
invUpdReservation = InventUpd_Reservation::newInventDim(InventMovement::construct(invTrans,InventMovSubType::None),myInventDim,200,false);

          invUpdReservation = InventUpd_Reservation::newInventDim(InventMovement::construct(invTrans,InventMovSubType::None),myInventDim,400,false);


     InventUpd_Reservation::updateReserveBuffer(journalTrans, journalTrans.Qty);

     InventUpd_Reservation::updateReserveBuffer(journalTrans, abs(journalTrans.Qty)); 




AXAPTA - Post invent journal which it's form open

If you want to post a record like this, AX will not let you post, with an error about record is using by another. This code part I learned from Volkan Şişman lets to post:

InventJournalCheckPost      journalCheckPost;
JournalForm                 journalForm;

journalForm      = JournalForm::fromArgs(args);
journalCheckPost = InventJournalCheckPost::newFromForm(args,journalForm);

15 Temmuz 2015 Çarşamba

AXAPTA - Flexible joins with InventDim Table using InventDimExistsJoin macro

There is a macro to create flexible joins with InventDim table with easy:

InventDimParm       dimParm;
InventDim           dimValues,dimJoin;
//Fill fields to use join where condition
 dimvalues.wMSLocationId = inventdim.wMSLocationId;
    if (inventdim.InventSiteId)
        dimvalues.InventSiteId = inventdim.InventSiteId;
    if (inventdim.configId)
        dimvalues.configId = inventdim.configId;
InventDimParm with fields

    while select lclInventSum
        where lclInventSum.ItemId == itemId && leftQty > 0

First parameter was related InventDimId field for join tables, second is InventDim tables local alias, values go with third parameter. The last one is parameter table. There ara different usages of that table.