Cleanup Script for MobXMLTable in AX2012

Problem

When you cleanup document queue the MobXMLTable is not included. 

Solution

Class: MobDocumentQueueCleanup

Method: run


delete_from xmlTable
                exists join mobDocumentQueue where mobDocumentQueue.TableId == xmlTable.RefTableId && mobDocumentQueue.recid == xmlTable.RefRecId && mobDocumentQueue.CreatedDateTime < DateTimeUtil::addDays(DateTimeUtil::getSystemDateTime(), - historyLimit);

delete_from mobDocumentQueue where mobDocumentQueue.CreatedDateTime < DateTimeUtil::addDays(DateTimeUtil::getSystemDateTime(), - historyLimit);


Add the highlighted with yellow from below image.