Notifications
Clear all
Trading Post
3
Posts
2
Users
0
Reactions
78
Views
Topic starter
So I'd like to display previous Orders with the date in a data display. I've tried all the basic MEL. I also see that the start date is field #4 and end date is #5. Has anyone figured how to pull those fields.
Thanks in advance.
Posted : May 7, 2014 4:08 am
Here is some code I had saved in my snippet library. It uses ORDERS_AFTER. You could modify it to print whatever fields you like. Calling the function is at the end of the code and you can just remove the cfmt() statement around it. That's what you would put in your data display:
This will pull in the orders with comments along with the diagnosis and the date it the order is due. !fn fnGetOrders(strList) { local lCounter local strOrderList local nStart local strBuf local strFormattedList = "" strOrderList = getfield(strList, "|", "") for lCounter = 1, lCounter <= size(strOrderList), lCounter = lCounter + 1 do strOrderList[lCounter] = getfield(strOrderList[lCounter], "^", "") strFormattedList = strFormattedList + str(lCounter) + "." /* Need to remove commas from problem name */ strBuf = strOrderList[lCounter][1] + " " + "(" +strOrderList[lCounter][3] + ") " + " – " + strOrderList[lCounter][6] + " " + "(" + strOrderList[lCounter][7] + ")" + " " + strOrderList[lCounter][4] + HRET + "Order Comments: " + strOrderList[lCounter][8] strBuf = ReplaceStr(strBuf, ",", "\,") strFormattedList = strFormattedList + strBuf + HRET endfor if (lCounter > 1) then strFormattedList = remove(strFormattedList, size(strFormattedList)) endif return strFormattedList } And call it with this to print. {cfmt(fnGetOrders(ORDERS_AFTER("DELIMITED")),"","Orders with comments: ", "b"," ")}
Posted : May 8, 2014 11:46 pm
Topic starter
Thank you! I will try this out
Posted : May 9, 2014 12:27 am