Tuesday, 10 February 2015

job to create a quality order

static void Job32(Args _args)
{

   InventQualityOrderTable      InventQualityOrderTable;
   NumberSeq                    NumberSeq;
   InventQualityOrderId         QualityOrderId;
   InventDim                    InventDim;

   try
    {



    NumberSeq=NumberSeq::newGetNum(InventParameters::numRefQualityOrderId());
    NumberSeq.used();
    QualityOrderId = NumberSeq.num();
    ttsBegin;
   
     InventDim.initValue();

    InventDim.InventSiteId = "3";
    InventDim.InventLocationId = "31";
    InventDim = InventDim::findOrCreate(InventDim);
    InventDim.insert();

    InventQualityOrderTable.initValue();
    InventQualityOrderTable.ReferenceType = InventTestReferenceType::Inventory;
    InventQualityOrderTable.QualityOrderId = QualityOrderId;
    InventQualityOrderTable.ItemId        = "M0061";
    InventQualityOrderTable.TestGroupId   = "Concentrat";
    InventQualityOrderTable.Qty           = 0.002;
    InventQualityOrderTable.InventDimId   = "AN41-001116";
    InventQualityOrderTable.insert();
   //  select InventDim  where InventDim.inventDimId == InventQualityOrderTable.InventDimId;
 
    InventDim.insert();
    ttsCommit;

    if(InventQualityOrderTable.Qty)
    {
        info("Quality order created");
    }
       
    }
   
  catch
    {
        checkFailed("error");
       
       
       
    }

}

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...