2014-12-02 11 views
5

HI ho riscontrato un errore durante l'aggiornamento di un record nella tabella inventata. Sto usando il seguente codice di esempio.Ax 2012 tts error

static void Job4(Args _args) 
{ 
    CsInvBOMSplitQtyCalcHelper bomCalc; 
    Qty       qty; 
    InventTable     inventTable; 
    InventTable     updateInventTable; 
    BOM       bom; 
    boolean      result; 
    BOMId      bomId;    
    BOMVersion     bomVersion; 
    ItemId      item  = "1000M-3C-Pcs"; 

    select firstOnly * from bomversion 
      where bomversion.Active == true 
      && bomversion.ItemId == item 
      && csIsLengthItem(item) == false; 

    if (0 != bomVersion.RecId) 
    { 
     select * from bom 
      where bom.BOMId     == bomversion.BOMId 
     exists join inventTable 
      where bom.ItemId    == inventTable.ItemId 
      && inventTable.CsIsLengthItem == true; 
    } 

    if (0 != bom.RecId) 
    { 
     result = true; 
     bomCalc = CsInvBOMSplitQtyCalcHelper::construct(item); 
     qty  = bomCalc.getAdvicedBOMSpoolQty(); 
    } 

    ttsBegin; 

    while select forUpdate updateInventTable 
     where updateInventTable.ItemId == item 
    { 
     updateInventTable.CsInvBOMSplitQty = qty; 
     updateInventTable.update(); 
    } 

    ttsCommit; 

    info(strFmt('%1, %2, %3', result, qty, inventTable.CsInvBOMSplitQty)); 
} 

Questo è l'errore che ottengo:

enter image description here

per favore mi aiuti a risolvere questo problema.

risposta

4

L'errore non è ovviamente causato da questo lavoro (ma forse una versione precedente).

basta eseguire questo piccolo lavoro per ripristinare il livello di TTS:

static ttsAbort(Args args) 
{ 
    ttsabort; 
} 

TTS errori di livello sono di solito causati da errori di programmazione, dicono chiamando return prima ttsCommit.

Problemi correlati