how to set report link to execute sql - liamlamth/blog GitHub Wiki

outcome

allow user click a row level link to execute plsql with row attribute e.g. approve request row button to update status = 'APPROVED'

action

1. setup link item property >> link >> target: URL
   javascript:$.event.trigger('APPROVE_REQUEST', [['#ID#']]);    ### multiple value: [['#ID#',#ITEM2#]]
2. setup variable item 'REQUEST_ID'
3. setup dynamic action
   3.1 when
       event:                   custom
       custom event:            APPROVE_REQUEST
       select type:             JavaScript Expression
       javascript expression:   document
   3.2 action 1
       action:                  set value
       set type:                JavaScript Expression
       javascript expression:   this.data[0]                     ### multiple value: this.data[1]...
       affected elements:       P3_REQUEST_ID
       fire on initialization:  off
   3.3 action 2
       action:                  execute server-side code
       language:                PL/SQL
       item to submit:          P3_REQUEST_ID
   3.4 action 3
       action:                  clear
       item(s):                 P3_REQUEST_ID
   3.5 action 4
       action:                  refresh
       region:                  report name
⚠️ **GitHub.com Fallback** ⚠️