I am working on customizing Purchase Req report customizations. As part of requirement i need to add list of approvers to PR report and hence i have to add another Tmp table to report objects.
The main Tmp table( insertIntoTempTable) which is being used by report is updated by an Private method.
I would like to extend DP class (PurchReqDP)'s insertIntoTempTable() method to add logic but since this method is private i can not use COC. So i ended up COC on insertIntoTempTable's Insert method. as following code
[ExtensionOf(tableStr(PurchReqTmp))] final class PurchReqTmpOI_Extension { public void insert() { str userName; OIPurchReqApproversTmp oiPurchReqApproversTmp; next insert(); PurchReqTmpOI_Extension::oiPopulateApprovalOwner(PurchReqTable::findPurchReqId(this.PurchReqId)); } private static void oiPopulateApprovalOwner(PurchReqTable _purchReqTable) { WorkflowWorkItemTable workflowWorkItemTable; WorkflowElementTable workflowElementTable; OIPurchReqApproversTmp oiPurchReqApproversTmp; while select ElementId,UserId,Status from workflowWorkItemTable where workflowWorkItemTable.RefTableId == _purchReqTable.TableId && workflowWorkItemTable.RefRecId == _purchReqTable.RecId && (workflowWorkItemTable.Status == WorkflowWorkItemStatus::Pending || workflowWorkItemTable.Status == WorkflowWorkItemStatus::Delegated || workflowWorkItemTable.Status == WorkflowWorkItemStatus::Completed) && workflowWorkItemTable.IsClaimed == true join ElementId, ElementType from workflowElementTable where workflowElementTable.ElementId == workflowWorkItemTable.ElementId && workflowElementTable.ElementType == WorkflowElementType::Approval { ttsbegin; oiPurchReqApproversTmp.PurchReqId = _purchReqTable.PurchReqId; oiPurchReqApproversTmp.OIPROwnerApprovalStatus = enum2Str(workflowWorkItemTable.Status); oiPurchReqApproversTmp.OIApprovalOwner = workflowWorkItemTable.userName(); oiPurchReqApproversTmp.OIApprovalDate = DateTimeUtil::date(workflowWorkItemTable.DueDateTime); oiPurchReqApproversTmp.insert(); ttscommit; } }
The Extension of PurchReqDP looks like as follow
[ExtensionOf(classStr(PurchReqDP))] final public class PurchReqDPOI_Extension { private oiPurchReqApproversTmp oiPurchReqApproversTmp; [SRSReportDataSetAttribute(tablestr(OIPurchReqApproversTmp))] public OIPurchReqApproversTmp getPurchReqApproversTmp() { select * from oiPurchReqApproversTmp; return oiPurchReqApproversTmp; }
Now issue is, I do see newly added oiPurchReqApproversTmp table get populated but when it comes to getPurchReqApproversTmp() to fetch data to show on report it does not have anything in it.
Please note DP class uses SRSReportDataProviderBase as base class.
Any help is really appreciated.
Thank you.