setTmp() : has nothing to do with deletion at all. It turns a buffer to a temporary one, therefore it saves records to memory/on disk instead of into database. If you delete everything from the temporary buffer, it doesn't delete anything in database, obviously.
So any data manipulations will be lost once the execution of this method is over and actual table content will not be affected.
Will use doInsert() to bypass any validation rules which are not required for temporary table.
As an example, we will use the vendor table to insert and display a couple of temporary
records without affecting actual data.
1. In AOT, create a new class called VendTableTmp with the following code:
server static void main(Args _args)
vendTable.AccountNum = ’1000′;
vendTable.Name = ‘Vendor 1′;
vendTable.PartyId = ’1′;
vendTable.AccountNum = ’1002′;
vendTable.Name = ‘Vendor 2′;
vendTable.PartyId = ’2′;
while select vendTable
“%1 – %2″,
2. Run the class to see results:
1000 Vendor 1
1002 Vendor 2
Post a Comment