Hi all
Running AX 2012 R3 CU9.
Having a small issue with an SSRS print-to-file report I'm running in batch. In the following example, TEE_Register_SubmitToLangdons class extends RunBaseBatch.
TEE_Register_SubmitToLangdons.parmJournal() is a getter/setter method I've created in that class in order to filter the output to only the variable journal ID.
I've confirmed if I manually call parmJournal() in the run() method
of the class, it will filter as expected. However I need to be able to do it at runtime when the job is run, which would involve calling it on the job.
For some reason even though I call it (as shown bold below) the value passed seems to be a blank string.
static void TEE_Register_SubmitToLangdonsJob(Args _args, str _journal)
{
BatchHeader batHeader;
BatchInfo batInfo;
TEE_Register_SubmitToLangdons rbbTask;
str sParmCaption = "Submit to Langdon's " +
date2str(today(),321,DateDay::Digits2,DateSeparator::Slash,DateMonth::Digits2,DateSeparator::Slash,DateYear::Digits4);
;
rbbTask = new TEE_Register_SubmitToLangdons();
_journal = "EXP-00009";
rbbTask.parmJournal(_journal);
info(rbbTask.parmJournal());
batInfo = rbbTask .batchInfo();
batInfo .parmCaption(sParmCaption);
batInfo .parmGroupId(""); // The "Empty batch group".
batHeader = BatchHeader ::construct();
batHeader .addTask(rbbTask);
batHeader .save();
info(strFmt("'%1' batch has been scheduled.", sParmCaption));
}
How do I get this to pass correctly?
Any help would be much appreciated, thanks very much in advance.
Cheers
Luke
*This post is locked for comments