Empty value

I modified my report that can see the ConFirmedDate and ApproveDate in workflow history

here my SQL query.

select 
		max(CASE WHEN APPROVALSTATUS = 40 then DATEADD(hh, 8, CREATEDDATETIME) else '' end) as [CONFRIMED DATE],
		MAX(CASE WHEN APPROVALSTATUS = 30 then DATEADD(hh, 8, CREATEDDATETIME) else ''  end) as [APPROVED DATE]
		
		
from AGSSALESTABLEWORKFLOWHISTORY 
where DATAAREAID = 'inf' and APPROVALSTATUS != 10
group by SALESID,CREATEDBY

 

and translate into X++ code.

 

what's wrong with this code?

select maxof(CreatedDateTime), CreatedBy from workFlowHistory
    group by SalesId, CreatedBy
    where workFlowHistory.SalesId == salesTable.SalesId;

    if (workFlowHistory.ApprovalStatus == VersioningDocumentState::Confirmed)
    {
        _tmpWizPSDDSDR.ConfirmedBy = workFlowHistory.ApproverName();
        _tmpWizPSDDSDR.ConfirmedDate = workFlowHistory.createdDateTime;
    }
    if (workFlowHistory.ApprovalStatus == VersioningDocumentState::Approved)
    {
        _tmpWizPSDDSDR.ApproveBy = workFlowHistory.ApproverName();
        _tmpWizPSDDSDR.ApproveDate = workFlowHistory.createdDateTime;
    }

I am getting empty value.

can you help on this.

 

Thanks

Parents Reply Children
No Data
Related
Recommended