Sunday 17 June 2012

Dynamics AX - skipDataMethods & set based operation

Sometimes when importing large number of records (Eg. millions of lines), the quickest way is to use:
  • insert_recordset
  • update_recordset
  • delete_from


But these set base operation will roll back to row-by-row operation when either of the following condition is true:
  • it is not an SQL table (Eg. temporary table)
  • Database log is enabled for the table
  • Alert is setup for this table
  • Record level security is enabled for the table
  • AOSValidation method is overwritten
  • when using insert_recordset
    • the .insert() method is overwritten
  • when using update_recordset
    • the .update() method is overwritten
  • when using delete_from
    • the .delete() method is overwritten
    • DeleteAction is defined


To prevent it from fallback to row-by-row operation, the following method can be used if:
  • Delete action is defined, use skipDeleteActions
  • Database log is setup, use skipDatabaseLog
  • Alert is setup, use skipEvents
  • Method is overloaded (.insert(), .update, .delete()), use skipDataMethods


Non-SQL table does not support set base operation.



NOTE: Only use these if it is logically correct to skip the row-by-row triggered operation (Eg. Database log, alert, RLS, overloaded method, etc)

Ref: http://msdn.microsoft.com/EN-US/library/aa849875

5 comments:

  1. thanks for a very complete post on the topic

    ReplyDelete
  2. Indeed a nice post. Thanks for sharing it.

    ReplyDelete
  3. good information, i didn't know it

    ReplyDelete
  4. Thanks for sharing this post!
    I just got mine from anegis consulting, and the whole implementation process was really easy and quick. Now I feel like I've gained more control over my company's growth.
    Regards.

    ReplyDelete
  5. Thanks for Sharing really helpfull to understand completely

    ReplyDelete