Box class

I still see a lot of X++ developers calling the Box class in code that is used in database transactions. It may cause nasty problems – as I show in this post. Imagine code like this, used in some table: void delete() { if (Box::yesNo("Are you sure?", DialogButton::No) == DialogButton::Yes) { super(); } } When …

Continue reading ‘Box class’ »

AX: Support for pessimistic locking

Let’s skip an introduction and jump right into code: while select forUpdate myTable { ttsBegin; myTable.MyField = ‘something’; myTable.update(); ttsCommit; } I meet such a code really often and it works very well under certain circumstances. Specifically, it requires optimistic record locking to be active. In such cases, Dynamics AX just check whether a record …

Continue reading ‘AX: Support for pessimistic locking’ »