skipDeleteActions(true) not works

Hi,

I set a property skipDeleteActions() to ‘true’ on a record, and use delete_from function, but the delete actions are still executed.

If anyone has encountered a similar problem?

Regards,

arnam

hii,

There is no relation between "DeleteAction " and sql DELETE command.

Delete action is used to put constraint on any table that is actually related to any other table.i.e, there is parent child relationship exists. for more information you can follow this link

http://msdn.microsoft.com/en-US/library/bb315018(v=ax.50).aspx

In X++ coding, we use DELETE and DELETE_FROM in terms of sql command to deal with the records stored in a database. It does not affect the behavior of these commands whether you have any delete action created on a particular table.

However, it is not recommended to use delete_from command while there is delete action exist on a table as it slows down the database performance.

Thats why the skipDeleteActions is used, which will avoid the fall back to record by record delete. But in order to maintain the data integrity, the data from the tables which are defined in the delete Actions should also be removed.

The delete will ultimately look into the delete actions, to maintain the data integrity.

Can you put a breakpoint in the delete method of the table (which is used in the delete action) and find out the source of deletion

Yes, that’s absolutely correct.

The source is:

[s] \Classes\xRecord\Delete

Nothing more.

According to MSDN (http://msdn.microsoft.com/en-us/library/aa630677(v=ax.50).aspx):

Gets and sets the property that indicates whether to ignore requests to delete records.

This method only work when using a set based operation, for example the delete_from statement. If you use it on a row based operation, for example the xRecord.delete method, the property will not be respected and the delete action will still be called.

…but in my application, it doesn’t work this way.

have you tried along with skipDataMethods(true)?

Yes, I’ve tryied it, with the same result.

Delete action have been executed.