Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

How to have code know if it is being run from a batch or not?

$
0
0

Hello All,

 

I am trying to debug some code with the below if statement:

GeacOutbound geacOutbound;

BatchHeader batchHeader;

 

if(batchHeader)

{

geacOutbound = GEACOutbound::newNoDate();

geacOutbound.run();

}

else

{

geacOutbound = GEACOutbound:newDate(runDate);

geacOutbound.run();

}

 

It seem to me the the if(batchHeader) statment is there to direct the class what to do if this class is run as a batch, but in testing it appears that the code is always executing the else command.

 

Short of turnning on debugging in visual studio so I can run batch jobs in debugging, is there any other documents on the BatchHeader class or ideas why this class is skipping the if(batchHeader) statments?

 

Another question I just thought of. Is the batch header always present when a class is run from RunBatchBase?

 

Thank you for any help on this,

 

Phil


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>