This discussion is archived
1 Reply Latest reply: Jun 4, 2013 6:01 AM by vdsadhi RSS

Link column from an interactive report to insert a row in a tabular form

1012536 Newbie
Currently Being Moderated
Hi, I need your help, i'm new on APEX and i really need to make a "link column" from an "interactive report" to insert a row into a "tabular form".

I mean that when you click the "link column" instantly create a new row in the Tabular form with the information of the linked row on the interactive report. Its something like that.

I really appreciate your help.

Ricardo Capuz
  • 1. Re: Link column from an interactive report to insert a row in a tabular form
    vdsadhi Journeyer
    Currently Being Moderated
    Hi Ricardo,

    You can use the following code as per your requirement (this is just an example),

    (In this case IR report is in Page#1 and Tabular form is in Page#2),

    On Page#1, Create a hidden item (i.e 'P1_ID')

    IR Report query as like the below,
    select empno,
    ename,
    job,
    mgr,
    hiredate, 
    sal,
    comm, 
    deptno, 
    empno "copy" 
    from emp
    Use the below JS code in Page HTML Header section,
    function f_insert_row(pSub)
    {
        $s('P1_ID',pSub);
        doSubmit('ADD');
    }
    Edit  Report Attribute -> copy column -> Under Column Link

    Link Text: Select your column name (i.e. #EMPNO#)
    Target: URL
    URL: javascript:f_insert_row(#EMPNO#);

    Then create a process to insert like below,
    BEGIN
    insert into emp_test (select * from emp where empno=:P1_ID);
    END;
    Process condition as * Request=Expression1* in Expression1 as 'ADD'.

    At last, create a branch to Page#2, Check 'include process success message' and with the same condition as * Request=Expression1* in Expression1 as 'ADD'.

    Thanks,
    Lakshmi

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points