user3436468
user3436468

Reputation: 31

How to reset the table values in AX 2012?

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

Answers (4)

mazzy
mazzy

Reputation: 1095

Full reset for all data fields and behaviour features:

TableName = null;

see feature example. TableName.clear(); clears only data fields.

Upvotes: 1

Roger
Roger

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

FH-Inway
FH-Inway

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

Jan B. Kjeldsen
Jan B. Kjeldsen

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

Related Questions