Thursday, November 13, 2014

Required check and update when deleting a backing entity for a financial dimension

When you delete a record that is also a backing entity for a financial dimension, you need to check that the financial dimension framework allows you to delete the backing entity and you need to update the financial dimension as being deleted.

This is done in the delete method of the backing entity.
The check takes place outside TTS:
// Check to see if the associated dimension attribute value has been used
// in a way that would prevent deletion.
if (!DimensionValidation::canDeleteEntityValue(this))
    throw error(strFmt("@SYS134392", this.PersonnelNumber));
And the update takes place within TTS:
// Update the associated dimension attribute value.

Examples of this can be found several places in standard AX, for example on the tables:
  • ProjTable
  • HcmWorker