Overriding insert() method on a table - it doesn't insert the records in the table

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

Does super() gets called? Does it completes without any exception?
What if you remove all the other code and keep super() only? Will you get a different result?

Yes, super() gets called and debugging runs smoothly and no error what so ever. But I don’t see the record in the table. I haven’t tried removing the other code just yet. I am only debugging a scenario for the positive if ( and not going into the else condition for now) just trying to get the record inserted.

Martin, Never mind. I just had to clear the caches/refresh elements and had to restart AOS for some other issue and it now inserts the records with same code above using super() and it is inserting the records. Thanks for taking time to look into it!