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

In CustCreditLimit class need to check the salesqty to be not more than as given in custom table

Creditinvoice report

Simple string functions to fill in built-in function gaps