Pages

Banner 468 x 60px

 

Wednesday, November 22, 2017

Create Mandatory with message using x++

0 comments
Create Mandatory with message using x++ :

 if (!CreditCardTable.Zipcode)
{
warning("Zipcode must be filled in!");
ret = false;
}

public boolean fetch()
{
    Query       _query = new Query(this.query());
    QueryRun    _queryRun;
    boolean ret;
    ;


    //ret = super();
    parmTtd = dialogTtd.value();

    if (parmTtd == NoYes::No)
    {
        TtdImage.visible(false);
    }
    else
    {
        TtdImage.visible(true);
    }

    _query.dataSourceTable(tableNum(VendPurchOrderJour)).addRange(fieldNum(VendPurchOrderJour, PurchId)).value(_vendPurchOrderJour.PurchId);
    _query.dataSourceTable(tableNum(VendPurchOrderJour)).addRange(fieldNum(VendPurchOrderJour, PurchTableVersion)).value(SysQuery::value(_vendPurchOrderJour.PurchTableVersion));
    //_query.dataSourceTable(tableNum(PurchLineAllVersions)).addRange(fieldNum(PurchLineAllVersions, ItemId)).value(SysQuery::value(_purchLineAllVersions.ItemId));

    _queryRun = new QueryRun(_query);

    //rowNum = 1;
    while (_queryRun.next())
    {

        if (_queryRun.changed(tableNum(VendPurchOrderJour)))
        {
            _vendPurchOrderJour = _queryRun.get(tableNum(VendPurchOrderJour));
            element.send(_vendPurchOrderJour);

            Keterangan = PurchParmTable::findPurchId(_vendPurchOrderJour.PurchId, _vendPurchOrderJour.ParmId).TECKeterangan;
            NoFax = PurchParmTable::findPurchId(_vendPurchOrderJour.PurchId, _vendPurchOrderJour.ParmId).TECNoFax;
            Payment = PurchTable::find(_vendPurchOrderJour.PurchId).Payment;
            //totalQty += CorrectPackingSlip.CorrectionQty;
        }

        if (_queryRun.changed(tableNum(PurchLineAllVersions)))
        {
            _purchLineAllVersions = _queryRun.get(tableNum(PurchLineAllVersions));

            if (_purchLineAllVersions.ItemId != TMPItemId)
            {
                element.send(_purchLineAllVersions);

                TMPItemId = _purchLineAllVersions.ItemId;
            }
        }

        //rowNum++;
    }

    if (row < 10)
    {
        while ((10-row) != 0)
        {
             element.execute(1);
             row++;
        }
    }

    if (row == 10)
    {
        element.execute(2);
        element.newPage();
    }


    return true;
}


0 comments:

A financial dimension value is based on the record and has been used on a transaction. You cannot delete the record

  SOLUTION delete in table DimensionAttributeLevelValue base on Bank Account  :  and Delete the Bank Account FINISH