I have a scenario where a service passes is data to AX, and then we use the SysOperationFramework to process that data without making the service client wait for processing to finish.
An issue arises if the user attempts to open the record in the external application while processing is still occuring.
Is there a way, in X++, so see which jobs are currently executing (and further, see the parameters that were passed in) so that we can send an error that we can handle to the user?
There is a way, yes. The data you are looking for is stored in the
Batchtable. You will find aClassNumberand a Status field. Just select a record matching your class that has the status executing. If a record exists, it is being executed.The parameters are stored in a the
Parametersfield in a container. You can unpack the container be creating an instance of your class and unpacking it, like so (quick code that will not compile but you get the point):