This post is machine-translated. The original post in german language can be found here.

Create pallet through code

The following job shows how to create a palette by code and it pulls the pallet number from a number sequence. Important in the latter case, is to the call numberSeq.used() so that the drawn number is marked as "used".

static void howToUseNumberSeq(Args _args)
{
    WMSPallet wmsPallet;
    NumberSeq numberSeq;

    #define.InventLocationId("12")
    #define.WMSLocationId("L01")

    ttsbegin;
    wmsPallet.clear();
    wmsPallet.initValue();
    wmsPallet.InventLocationId = #InventLocationId;
    wmsPallet.wmsLocationId    = #WMSLocationId;

    numberSeq = WMSPallet::numberSeq(true,true);
    if (numberSeq)
    {
        wmsPallet.wmsPalletId  = WMSPalletIdGenerate::newPalletIdFromNumberSeq(numberSeq);
        numberSeq.used();
    }

    if(wmsPallet.validateWrite())
    {
        wmsPallet.insert();
    }
    else
    {
        throw error("@SYS96731");
    }
    ttscommit;
}
These post applies to following version:
Dynamics AX 2012

 
 

 

 
 
 
Posts of the actual month
November 2024
MoTuWeThFrSaSu
 123
45678910
11121314151617
18192021222324
252627282930 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.