Reputation: 31
Can I use like this to reset the table variable in AX?
I have tried with the below piece of code:
Table_Name.RecId=0;
Upvotes: 3
Views: 7534
Reputation: 1095
Full reset for all data fields and behaviour features:
TableName = null;
see feature example. TableName.clear();
clears only data fields.
Upvotes: 1
Reputation: 101
Clear is to erase field values of te object in order to rehuse the object in a loop. Delete has a direct impact into SQL Database.
Upvotes: 1
Reputation: 5107
You can use the .clear() method that is available on all tables to clear/reset all table fields, including the RecId field.
Table_Name.clear();
Upvotes: 7
Reputation: 18051
Have you considered deleting the record instead?
Table_Name.delete();
The field RecId
identifies the record and cannot meaningful be reset.
Upvotes: 1