Thursday, 25 February 2016

only one record is checked in a column for a table

say we have a requirement that we have a table and in that table we have many records  for theses records any given point of time only one record should be checked.

go to table table modified and write:


public void modifiedField(FieldId _fieldId)
{
    NumberSequenceTable    NumberSequenceTable;
    ;
    super(_fieldId);
    ttsBegin;

    if(this.Default == NoYes::Yes)
 
    {
        while select forupdate NumberSequenceTable
            where NumberSequenceTable.RecId != this.RecId
        {
          NumberSequenceTable.Default = NoYes::No;
           NumberSequenceTable.update();

        }
    }

    }

    ttsCommit;

}

here we are interating for all the records in the table where rec id does not match and make all the other records as false.

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

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