Hi,
I am overriding a table insert() method to compare the current incoming record that is about get inserted with the already existing record if there is one. If the records exists then do some other logic. If the record doesn’t exist then just insert the record in the table. Here is the logic below how I have it. It executes just fine no errors but the record doesn’t seem like inserting into the MyTable. Thought call to the super() would insert the record, I am not sure if I am missing something here. Does it look right? I haven’t tried with the myTable.doInsert() just yet I will but just wanted to see if call to the super() would work?
{
MyTable myTable, currentmyTable;
boolean modified;
myTable= MyTable::find(this.Voucher, this.Transdate);
if(!myTable)
{
//myTable.doInsert();
super(); //Thought call to the super() would insert the record. It is executing but it doesn't seem like inserting the record in the table.
}
else
{
myTable.selectForUpdate(true);
currentmyTable = this.setCurrentRecord(this);
[myTable, modified] = this.compareRecords(myTable, currentmyTable);
if(modified)
{
myTable.update();
}
}
}
Thanks!
type or paste code here