Wednesday, 25 December 2013

Work flow table with link

SELECT   wn.notification_id,
         aerh.invoice_num,
         TO_CHAR (wn.begin_date, 'DD-MON-YYYY hh:mi:ss') begin_date,
         wn.to_user,
         wn.from_user,
         wr2.display_name preparer,
         wr3.display_name reported_for,
         wn.status,
         wn.mail_status mail_status,
         aerh.expense_status_code,
         WR.email_address,
         aerh.total,
         aerh.report_submitted_date,
         aerh.description
  FROM   wf_notifications wn,
         wf_item_activity_statuses was,
         wf_items wi,
         ap_expense_report_headers_all aerh,
         WF_ROLES WR,
         wf_roles wr2,
         fnd_user fu,
         wf_roles wr3
 WHERE       1 = 1
         AND wn.notification_id = was.notification_id
         AND was.item_type = wi.item_type
         AND was.item_key = wi.item_key
         AND wn.status IN ('OPEN', 'CANCELED')
         AND wn.message_name = 'OIE_REQ_EXPENSE_REPORT_APPRVL'
         AND aerh.invoice_num = wi.user_key
         AND aerh.expense_status_code IN ('PENDMGR', 'RESOLUTN')
         AND WN.recipient_role = WR.name(+)
         AND wi.owner_role = wr2.name
         AND aerh.employee_id = fu.employee_id
         AND fu.user_name = wr3.name(+)

No comments:

Post a Comment