Quantcast
Channel: Martin Dráb's Activities
Viewing all articles
Browse latest Browse all 17532

Filtering View Computed Column Returns Empty

$
0
0

Hi,

I created a Sales Order View with a computed column Payment Date. Payment Date is the latest CreatedDateTime of a payment made for a particular Sales Order. This field is displayed in a grid on form. The method is written as follows: 

public static server str latestPaymentDate()
    {
        DictView dv = new DictView(tableNum(SalesOrderHeaderView));

        str s = strFmt('SELECT TOP 1 CreatedDateTime1 FROM MCRCUSTPAYMTABLEVIEW WHERE MCRCUSTPAYMTABLEVIEW.RefRecId = %1 AND MCRCUSTPAYMTABLEVIEW.RefTableId = 2509 ORDER BY CreatedDateTime1 DESC',
        dv.computedColumnString(tableStr(SalesTable), fieldStr(SalesTable, RecId), FieldNameGenerationMode::WhereClause));

        return strFmt('ISNULL((%1), \'\')', s);
    }

I was able to sort the column but filtering it will return empty results every time and of course I have made sure the filtered value exists. I also tried advanced filtering statements like (Day(0)), (DayRange(0,0)) but still returns empty. 

What's more weird is, I have another computed date called Complete Date, which is the latest confirmation date for the sales order. No issue with this Complete Date field. 

So I thought there must be something wrong with my query. But I'm not sure what's wrong. The returned values are correct.

What else could be the root cause? 

Thank You.


Viewing all articles
Browse latest Browse all 17532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>