Creating dialog box for the cancel of SalesOrder packingslip form

Creating dialog box for the cancel of SalesOrder packingslip form:

void clicked()
{
    // + My Comment (Added by incadmin - INC-vinod - Start 04/11/2018)
    Dialog          dialog = new Dialog("Enter Comments");
    DialogField     dialogcomment;
    NotesLine       comments;
    CustPackingSlipJour     CustPackingSlipJourloc;
    // - My Comment -INC-Vinod - End

    #ISOCountryRegionCodes
    CustPackingSlipJour localCustPackingSlipJour = custPackingSlipJour.data();

    // + My Comment (Added by incadmin - INC-vinod - Start 04/11/2018)

    dialogcomment = dialog.addField(Extendedtypestr(Notes),"Comments");
    if(dialog.run())
    {
        comments = dialogcomment.value();

        if (
            SysCountryRegionCode::isLegalEntityInCountryRegion([#isoRU]) ||
            Box::yesNo("@SYS331615", DialogButton::No) == DialogButton::Yes)
        {
            CustPackingSlipJourFormHelper::checkCanProcessPackSlipCancellation(custPackingSlipJour);

            select forUpdate CustPackingSlipJourloc where CustPackingSlipJourloc.RecId == localCustPackingSlipJour.RecId;
            {
                ttsBegin;
                CustPackingSlipJourloc.INC_NotesLine = comments;
                // + My Comment (Added by incadmin - INC-vinod - Start 28/11/2018)
                CustPackingSlipJourloc.INC_CancelledBy          =   curUserId();
                CustPackingSlipJourloc.INC_CancelledDateTime    =   DateTimeUtil::utcNow();
                // - My Comment -INC-Vinod - End
                CustPackingSlipJourloc.update();
                ttsCommit;
            }
            super();
            refreshCaller = true;
            if (localCustPackingSlipJour.isCanceled())
            {
                info(strFmt("@SYS331616", localCustPackingSlipJour.PackingSlipId));
            }

        }
    }
    // - My Comment -INC-Vinod - End
}

Comments

Popular posts from this blog

We will follow the following steps in the AX development.

Need to provide “ItemId lookup” based on "ItemType" field, which selected while creating SalesOrder

How to retrieve multiple selected records from Grid using X++