Search code examples
oracle-apexoracle-apex-5oracle-apex-5.1

How to write email on a link column of Interactive report in oracle apex 5.1


I have created a report in which I have a link column. What I want to do is to send an email to the given id when I click on that link. I have created a dynamic action to send an email which is working fine. But, the problem is I wrote it on after refresh that's why it is generating two mails. I want to ask how can I trigger that action when the link is click?


Solution

  • I do not know how is your code to send email, but I suppose that code receive a id number as input and do the work to send the email.

    To do this without reload the page follow this steps:

    1 - Create an item in your page to store the id to send the email.

    2 - On the column of your report that have the link, go to "HTML Expression" and set this code (make the necessary update).

    <span onclick="$s('P9_MYITEM',#MYID#);">#MYSHOWVALUE#</span>
    <!--MYID and MYSHOWVALUE are columns of your select.-->
    

    enter image description here

    2a - If you are using a link column, go to "Link Builder Target", select URL as type and put this on "URL" field (make the necessary update):

    javascript:$s('P9_MYITEM',#MYID#);
    

    enter image description here

    3 - Now, just create a dynamic action when change this item, submit this item to get the changed values.

    enter image description here

    4 - Do not forget to set to "NO" the option to "Fire on Initialization".