Saturday, October 1, 2011

AX for Retail – Import Logs operation fails when run in batch

As part of the process to receive a purchase order from the POS client the Import Logs operation needs to run.  When performing an Import Logs operation in batch, the process will always fail.  The reason this fails is that one of the methods attempts to update the Import Logs form, which is not present when running in batch.  In order to allow the batch processing, make the following changes to \Classes\HHTProcessImportLog\runEnd

protected Integer runEnd()
{
;
    this.updateBlock(HHTImportStatusTypeBase::Processing,HHTImportStatusTypeBase::Ended);

  if (!this.isInBatch())
  {
    if (formHasMethodBookRefresh == unknownNoYes::Unknown)
        formHasMethodBookRefresh = formHasMethod(this.formRunObject(),identifierStr(bookRefresh)) ? unknownNoYes::Yes : unknownNoYes::No;

    if (formHasMethodBookRefresh == unknownNoYes::Yes)
        this.formRunObject().bookRefresh();
  }

    return 0;
}

No comments:

Post a Comment