SysSetup.loadData Method [AX 2012]

Loads the default data with which a module will ship.

public void loadData()

Run On

Called

This method will be called during a fresh install, during an upgrade, and whenever a configuration key is enabled. It can also be run manually at any time.

Please abide by the following guidelines when you implement this class and provide an implementation for this method:

  1. All tables that are written to must have a unique key that is not a record ID.

  2. The unique key of the table must be checked before data is inserted, and if the row exists, do not insert. Never introduce duplicate rows.

  3. Never delete or modify data; perform inserts only.

  4. This method must be idempotent.

  5. Never print, send messages to the Infolog, or use any UI elements. Otherwise the installation will fail; the throw statement is acceptable error handling.

  6. Specify all tables that the class writes to using the SysSetupTableAttribute attribute.

  7. Specify any configuration keys that must be enabled to use this data by using the SysSetupConfigKeyAttribute attribute.

  8. Do not introduce circular table dependencies across classes; any circular dependencies must be handled within one class. Run the SysSetupInstallerTest unit test before submitting your code to verify.

  9. If lots of rows are being inserted, make sure that it is being done in bulk to maximize performance.

See the existing SysSetup class implementations for reference and specific implementation ideas.

Community Additions

ADD
Show: