Is it possible to see the last workflow message when I open any record just beside/below the status field?
Solution:
Yes, It is possible with 2 different approaches. Let take this example and display the last memo in work order application.
A. Directly with the relationship, no need for a view also.
B. Create a View to handle a query
A. Start with easy way, just relationship and display the field
- add the following relationship to the workorder
- Relationship: LAST_MEMO_VIEW
- Where Clause: ownertable= 'WORKORDER' and ownerid= :workorderid and memo is not null and transid in (select max(transid) from wftransaction where ownerid= :workorderid and memo is not null)
- Child Object: WFTRANSACTION
- Now in the application designer just add a new text field and put LAST_MEMO_VIEW.MEMO in attribute property and make it read-only also.
--------------------------------------------------------
Let start with option 2.
1. Create a View based on below SQL , and name it MEMO_VIEW
CREATEOR replace VIEW memo_view asSELECTw.ownerid,w.OWNERTABLE,w.MEMO,w.TRANSDATE,w.ACTIONPERFORMED,wfa.ACTIONID,wfa.INSTRUCTION,wfa.PROCESSNAME,ACTION.value2 AS StatusFROMWFTRANSACTION wLEFT JOIN wfaction wfa ON wfa.ownernodeid = w.nodeidAND wfa.actionid = w.actionidAND wfa.PROCESSNAME = w.PROCESSNAMEAND wfa.PROCESSREV = w.PROCESSREVLEFT JOIN "ACTION" ON action.ACTION = wfa.ACTION 1 = 1 --and ownerid = (SELECT TICKETuID FROM TICKET WHERE TICKETID = '495880')AND w.memo IS NOT NULL
2. Create a database relation in Workorder Object to Memo_View, let say, we do this for Workorder :
- Object: WORKORDER
- Relationname: LAST_MEMO_VIEW
- Child Object: MEMO_VIEW
- Where:
OWNERID = :workorderid and OWNERTABLE = 'WORKORDER'AND TRANSDATE = (SELECT max(TRANSDATE) FROM MEMO_VIEWWHERE ownerid = :workorderid and OWNERTABLE = 'WORKORDER')
3. Now in the application designer just add a new text field and put LAST_MEMO_VIEW.MEMO in attribute property and make it read-only also.
No comments:
Post a Comment