Is it possible to prompt Dialog while Database transaction is in process on server?

Hi All,

I have created one dialog using RunBase framework

suppose we take example of Batch Process of Firm Planned order to Production orders.

Let’s start with this example,

Firstly i select all required BOM items, then i will do firm on the prompt dialog.

so process of creating Production order will works in between TTSBEGIN & TTSCOMMIT.

In process firstly it will fetch Number sequence from Prod Table using NumberSeq Class & ProdTable.

Now i have code that if number sequence which will be used for Production Order is marked with flag then one dialog will be prompt to select number seq and when user will select number sequence first time then whole process of creating prod order will be done using that selected number seq. instead of ProdTable number seq.

now my problem is when i prompt dialog in between TTSBEGIN & TTSCOMMIT then everything works fine until user clicks on OK or CANCEL.

When user clicks on OK or CANCEL AX 2009 gives following error4721.ttsError.png.

Please share your idea…

Thanks & Regards,

Mehul Thacker

User interaction in a transaction is a bad idea. For example, the transaction may hold exclusive locks in database - unless the user closes the form, nobody else would be able to use the same resources.

If you used RunBase framework in a normal way, you wouldn’t get into this situation. You should ask for parameters first, then let RunBase framework to pack them and send to server. You should start the transaction in run(), running on server. Try to think about how would you do it in a batch - you have to get input first, then save it to database and run the process without any interaction at some scheduled time.

Hi Martin,

Thanks for replay. ya i do understand your point but there is no option left with developer and user want interaction at specific point then?

is there any way to provide user interaction or something similar to this in AX 2009?

Thanks & Regards,

Mehul Thacker

You really don’t want to do it. Change the requirement or the design, but don’t continue with this idea.

If you need to do some processing, then get a user input based on results of the operation and then to start another process based on the input, that’s obviously no atomic operation. You even don’t know whether the user will ever give you any input.

I guess you want to inject your dialog to some existing RunBase child, but what you really have to do (if you don’t find better solution of the user requirement) is to refactor the process to two parts. You also mentioned a batch process - there can’t be any user input in the middle of batch, because there is no user - if you changed any RunBaseBatch in that way, it would wait for user input and never completed.

Hi Martin,

Thanks for support. finally i have asked the user to fill the value before process begin. As there is no way to prompt dialog between transaction in AX 2009!!

Thanks & Regards,

Mehul Thacker