post PackingSlip through X++

HeikoHeiko Member Posts: 17
edited 2007-09-19 in Dynamics AX
i tried to post a PackingsSlip through X++,
but i got no entry in tables VendPackingSlipJour, VendPackingSlipTrans, VendPackingSlipPurchLink and InventReportDimHistory

the entry in InventTrans won't modified and also the purchStatus in PurchTable and PurchLine

has anyone a idea?

static void PackingSlip_Posting(Args _args)
{
    PurchFormLetter         purchFormLetter;
    PurchId                 purchId;
    PurchTable              purchTable, update_purchTable;
    PurchParmTable          purchParmTable;
    ParmId                  parmId;
    PurchLine               purchLine, update_purchLine;
    PurchParmLine           purchParmLine;
    Num                     packingSlipId;
    ;


    purchId=   "00257_049";
    packingSlipId= purchId;

    purchTable=PurchTable::find(purchid);
    purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);

    purchFormLetter.specQty        (PurchUpdate::All);
    purchFormLetter.transDate      (systemDateget());

    purchFormLetter.initParmDefault();
    purchFormLetter.createParmUpdate();

    purchFormLetter.createParmTable(purchParmTable,purchTable);

    purchParmTable.Num = packingSlipId;
    purchParmTable.ParmJobStatus = ParmJobStatus::Executed;
    purchParmTable.insert();

    while select purchLine
        where purchLine.PurchId == purchTable.purchId
           && (purchLine.RemainPurchPhysical > 0)
    {
        purchFormLetter.createParmLine(purchLine);
    }

    purchFormLetter.proforma       (false);
    purchFormLetter.printFormLetter(true);
}

Comments

Sign In or Register to comment.