Adding a timeout control to a no yes dialog box has some value. While the standard system does not allow you to control a form in this way for boxes, it is possible to modify the system to achieve this.
When dealing with performance, there is a new control under the AX query system called Query::Insert_Recordset. This allows mutliple records to be inserted into a table, with a single SQL call, in the same way the insert_recordset command works.
While this command is great for performance, there is a problem with the standard crosscompany control when using the query::Insert_recrodset comamnd. The crosscompany controls only build the extended select statement to include the comapny control (dataareaid) when the queryrun class is used. If since the query::insert_recordset does not use the the queryrun class, the crosscompany control does not work, and will not filter the data across companies based on any rules you apply. It will however extract data for all companies.
The only work around that I have found is to add the dataareaid into the query, selecting the companies you want to use, this then includes the company control into the SQL statement ensuring only the companies you are interested in are processed.
There are a few things to think off when writing code, design requirements and performance. If we include the thought process of performance when developing we can often improve our overall code performance at the time of writing.
There are often times that we write a method within a method to reduce the amount of code we have to write and often to allow for recursive code. This would look something like: