Ina Saved Search, I want to get the most recent va...
# suiteanalytics
n
Ina Saved Search, I want to get the most recent value of the System Note where Field = Printed Picking Ticket either T or F. I'm using
CASE WHEN {systemnotes.field} = 'Printed Picking Ticket'  AND {systemnotes.newvalue} = 'T' THEN '1' ELSE {systemnotes.field} END
which works for the most recent System Note. Once any other note goes onto the sales order then the above formula no longer provides the result. I feel it needs an
ORDERBY {systemnotes.date}
in the formula but I cannot get that to work. Any SQL tips? (the Saved Search results option "When Ordered By Field" doesn't work for this.
t
Have you tried restrciting the system notes field you want to display in the criteria of the search?
n
thanks @Tristan Day. a good solution. I was getting caught up in the complexity of my search and its suitelet.
👍 1
t
ha, we've alllll done that!
n
Problem for me now is that when it hasn’t been printed it no longer meets the criteria.
t
So 'F' doesn't return? I take it the system ntoes are only being saved on update?
n
When a Sales Order exists a system note "Printed Picking Ticket" doesn't exist at all until the Print Picking Ticket is used for the first time.
t
Perhaps add IS NULL as an "or" in the condition?