Calling a procedure/function in forms personalization

Hi,
Can any one please help me in calling a procedure/function from the forms personalization? The requirement is to create an attachment when ever a new order line is created in R12. So for this, I created a procedure which calls attachment creation API. And in the forms personalization, I am doing the following.
Trigger Event: WHEN-VALIDATE-RECORD
Trigger Object: LINE
Condition: :LINE.INVENTORY_ITEM_ID is not null
Action Type: Builtin
Builtin Type: Execute a Procedure
Argument: =xx_test_attachment_new(:LINE.LINE_ID,20,'OE_ORDER_LINES',1,'test123')
This procedure works individually if I call it from TOAD.
Help is really appreciated?
Thanks,
Sri.

A question for the Forms ?
Nicolas.

Similar Messages

  • How to call database procedure in oracle forms

    Hi,
    Can anyone describe me that how I'll call database procedure in oracle forms (6i,10g)?
    Thanks in Advance.
    Baloch

    Hi Francois,
    As I created a procedure in database as below
    create or replace procedure For_table (tbl_of in number,st_pnt in number,en_pnt in number) is
    begin
    for i in st_pnt..en_pnt loop
    dbms_output.put_line(tbl_of||'*'||i||'='||tbl_of*i);
    end loop;
    end For_table;
    The above procedure is working fine when I'm using PL/SQL. I call the above procedure as
    begin
    For_table(3,5,20);
    end;
    but nothing happen
    Thanks in Advance.
    Baloch

  • FRM-40734 when calling external DLL Function from Forms 6

    Even though some answers were given to my previous help request ("Again: Forms 6 and user-defined data types") I wasn't able to solve the problem of passing a parameter of an user-defined type to an external DLL function residing in the SECURSIGN.DLL library (the closest solution was to declare that "composite" parameter using the ROWTYPE clause referencing a custom-made table created just for the sake of defining that perticular datatype).
    So I concentrated on SECURSIGN.DLL functions using more trivial data types, like a function requiring just four character strings as parameters.
    I generated the necessary PL/SQL support using the FFI.
    I discovered that also the simplest calls to external functions fail at runtime with the generic error FRM-40734.
    I located the error: it happens just at the moment of calling the function from within the FFI-generated package body. Before that, the DLL is loaded with no problem, the function is correctly registered, and a function handle is regularly returned.
    As long as I can regularly issue the very same call with the very same parameters from Visual Basic, I can't understand what's going wrong (ALL the needed DLL are in the same directory as the FMB/FMX forms).
    I will greatly appreciate any help that You may be able to provide.

    I have noticed just now that a dump file having a name like ifrun60_dump_299, is generated by FORMS every time I issue the aborted call to the foreign function.
    Inside the form dump file, apart from useless info like Registers and so on, the message:
    "Could not find Module32First"
    By a FILE/FIND/CONTAINING TEXT I searched all the DLLs, and I noticed that Module32First is a routine that can be found within each of the following DLLs:
    Cl32
    d2kwut32
    d2kwut60
    I tried to load those DLLs along with SECURSIGN.DLL by modifying the PROCEDURE LoadLibrary into the FFI-generated PLL code, and I have apparently no problem in loading all the DLLs that I wish, but the error persists, and that dump file is constantly generated, always looking for the "Module32First" routine.
    How can I avoid all that mess and the FRM-40734 error??

  • Calling a procedure from Oracle Forms with OUT parameter

    HI,
    Can anyone tell me in detail how to call a procedure with OUT parameters from Oracle Forms 6i ?
    Thanks in advance.

    Hello,
    Just provide the out parameter in the call:
    Declare
      amount   number; -- OUT number argument populated by the procedure
    Begin
      -- call the X procedure --
      x( amount ) ;
    End;Francois

  • Calling a procedure dynamically in forms

    Hi all
    I'm using Oracle 6, is there anyway to call a procedure dynamically, i mean the procedure called differs according to a certain condition. The procedure is local in the form not in the database, how can this be achieved
    Thanks

    Hello,
    user497979 wrote:
    what i want is as the following
    IF cond = 1 THEN
    proc1;
    ELSIF cond = 2 THEN
    proc2;
    ELSIF cond = 3 THEN
    proc3;
    .................. so onWell, i think the way you are showing with IF CONDITION is smart enough to call the procedures. And it will be also easy to understand.
    I'm searching for a way to call the procedure as follows
    proc||cond for exampleBut why? What is the purpose to do like this? Any efficiency or any logical reason?
    Another option You can create one procedure and call the code depend on parameter you pass like
    PROCEDURE MY_PROC(pCond IN NUMBER) IS
    BEGIN
      IF pCond=1 THEN
        -- Do something here...
      ELSIF pCond=2 THEN
       -- Do something here...
      ELSE
       -- Do something here...
      END IF;
    END;And while calling the procedure you can call the procedure by passing the value of pCond upon your requirement like
    MY_PROC(<parameter value>);But still the IF CONDITION exists either you use inside or outside the procedure.
    -Ammad

  • How to call a particular Customer through form Personalization

    Hi,
    Environment :- R12
    I have a requirement, to search a Customer info based on Sales Order form.
    Requirement:
    1. Open the Sales Order form, Query any order
    Now the user wants to pull the XBC Cusotmer information which was in the Customer Field.
    Naturally we can do by form personalization but here the Customer window is web based one. Can anybody have a hands-on on this. Please let me know.
    Thanks,
    ABR

    Pl see if the steps in MOS Doc 856139.1 ((Pics) How To Create Personalized Views For All Users In Professional Buyer Work Center) can help.
    HTH
    Srini

  • Problem calling program unit function in Forms 6i

    Hi,
    I'm new to programming with Oracle Forms. I have a question that I cannot seem to figure out. In Forms 6i, I have created a program unit function that compiles correctly. The trouble I'm having is calling it and displaying the function's contents into a non-database display item I created. When I run my app, the display item it blank while my other fields populate.
    I first tried to call it in a POST-QUERY trigger but I get an error stating "function cannot be called in SQL." Can you not call a function in a form's trigger? If so, what would be the correct syntax?
    Then I tried to call it in the non-database item's Calculation => Formula (property) by just stating the function_name(parameter). This appears to compile fine too, but still no display at runtime.
    What would be the best way to reference my function to display its contents properly? Does anyone have any examples? Any help would be greatly appreciated. Thank you.

    First, get rid of the
    EXCEPTION WHEN NO_DATA_FOUND
    in your function. Summary queries never raise no_data_found; They just return null.
    Your ":history.consecutive_years := NumberOfYears(:student.id);" is the proper way to call the function. That is what I was trying to tell you with the example: ':Myblock.Item_x := function_name(some_parm);' code
    If your post-query trigger only executes the function, then I think your problem is somewhere else:
    'FRM-40735 POST-QUERY trigger raised unhandled exception' looks like a problem elsewhere.
    Don't know of a good website. Just keep asking here -- somebody is bound to pop in and help you out.
    One more thing: drop this into your form-level on-error trigger. It often helps to find problems:
    -- On-error form-level trigger                                       --*
    DECLARE
      Err_Code NUMBER(5)     := ERROR_CODE;
      Err_Text VARCHAR2(100) := ERROR_TEXT;
      MSG      VARCHAR2(150)
              := SUBSTR('   '||ERROR_TYPE||'-'||TO_CHAR(Err_Code)||': '
                                         ||Err_Text,1,150);
      DBMS_TXT VARCHAR2(500);
    BEGIN
      IF Err_Code IN (40401,40405,     --No changes to save/apply
                      40100,40352) THEN --at first/last record
        MESSAGE(MSG,NO_ACKNOWLEDGE); -- Don't raise Form_Trigger_Failure
      ELSE -- all other messages
        -- check database error message --
        DBMS_TXT := SUBSTR(DBMS_ERROR_TEXT,1,500);
        if  DBMS_TXT is not null
        and substr(DBMS_TXT,5,5)
          not in('00000',
                 '01403') then --1403=no data found
          -- show entire msg, add new_line chars.
          DBMS_TXT := replace(DBMS_TXT,'ORA-',chr(10)||'ORA-');
          DBMS_TXT := replace(DBMS_TXT,' '||chr(10), chr(10));
          -- show MSG and DBMS_TXT both as an alert --
          --PLL_ALERT( ltrim(MSG) || DBMS_TXT );
          Message(ltrim(MSG) || DBMS_TXT );
          Message(' ',no_acknowledge);
          Raise Form_Trigger_Failure;
        else
          Message(MSG);
          Message(' ',no_acknowledge);
          Raise Form_Trigger_Failure;
        End if;
      END IF;
    END; -- end of on-error trigger

  • Calling stored procedure in Oracle forms

    I have a stored procedure in Oracle which is declared as follows in the package
    SFCS1.Company_Selection(O_Cursor IN OUT T_Cursor, cls IN Varchar2);
    Where T_Cursor is defined as a Ref Cursor
    From the Oracle forms I'm using the following code
    SFCS1.Company_Selection(A,my_cls);
    go_block('Block50');
    Execute_Query;
    I get the error message "FRM40505:Oracle Error: Unable to Perform Query". If I hardcode the value of my_cls in the query it runs properly. Any solutions will be really helpful
    Further to this, I want to put the single quotes around a value (for eg. 'A') from a variable. For instance I'm getting a value from my_cls and for the output I want to surround it with the single quotes, can somebody tell me how to do it.
    Thanks in advance

    This is a bit of a roundabout way to do it? Try setting up the block data source as procedure and set the values in the property palette of the data block.
    e.g.
    Query Data Source Type = Procedure
    Query Data Source Name = SFCS1.Company_Selection
    Query Data Source Columns = (Whatever columns/items you have in your datablock)
    Query Data Source Arguments = Argument names are your ref cursor and your variable.
    Check out basing data blocks on Ref Cursors.
    HTHs
    L :-)

  • Calling a procedure/function in CO using Callable Statement

    Hi,
    Please help me in understanding this:
    __method1__
    BEGIN
    :1 := Package.Function(
    param1 => :2"
    ,param2 => :3"
    ,param3 => :4"
    ,param4 => :5"
    END;
    method2
    BEGIN
    Package.Function(:1, :2, :3, :4, :5);"
    END;
    Whats the significance of using method1?
    I have seen the callable statements written as in method1 but, the parameters passed are not in order and not all params are passed.
    When i tried writing similar code, I got "Invalid Column Index" exception. Please let me know how to overcome this.
    Thanks

    Hi,
    You can call a function using Callable Statement as
    public String checkprimarycontact(String pri_loc_id,String org_id,String party_id)
    int p_location_id = 0;
    int p_org_id = 0;
    int p_party_id = 0;
    p_location_id = Integer.parseInt(pri_loc_id);
    p_org_id = Integer.parseInt(org_id);
    p_party_id = Integer.parseInt(party_id);
    String priflag = "";
    try
    Connection conn1 = getOADBTransaction().getJdbcConnection();
    CallableStatement cstmt1 = conn1.prepareCall("{? = call GET_PRIMARY_FUNCTION(?,?,?)}");
    cstmt1.registerOutParameter(1,Types.VARCHAR);
    cstmt1.setInt(2,p_location_id);
    cstmt1.setInt(3,p_org_id);
    cstmt1.setInt(4,p_party_id);
    cstmt1.execute();
    priflag = cstmt1.getString(1);
    catch(Exception e1)
    e1.printStackTrace();
    return priflag;
    Thanks,
    Gaurav

  • Form Personalization Executing a Built-in

    I am trying to call a procedure through the form personalize, but I can put parameters.
    This is what I am trying to do:
    JE_UBS_BU_BILLING.UPDATE_PAYMENT_DOCUMENT(${item.app_folder.customer_trx_id.value}|)
    What I am doing wrong?
    Thanks.

    Can you create a view on the remote database? If so
    CREATE VIEW rowtohex_view
    AS
    SELECT ROWTOHEX(column_name)
      FROM table_nameThen you can refer to this view over the database link.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Error when calling procedure from form personalization

    Hi every body
    I want to call a procudre using form personalization . I made the procedure and in form personalization i call it as follow:
    built in type : Execute a Procedure
    Argument :
    ='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )'
    but the following error raised when i click on Apply Now button :
    the string (='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )' )
    couldn't be evaluated because of error ORA-06550 :line 1 , column 43
    PLS-00103:encountered the symbol ")" while expecting one of the folowing (- + ...... etc
    can anyone have a solution to this problem because it made me mad .(urgent)
    Or if anyone have another way to call the procedure ??
    Note that i want to pass db_session_id to the procedure from the application so does anyone have a complian about the way of passing this parameter to the procedure ??

    See http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/forms-personalization-execute-a-procedure-1778674

  • Calling stored procedure from Forms 6.0(developer)

    Friends,
    Thanks for your replies. I am really grateful for your help for my last query. But I still have one hitch. How do I call from Developer 2000 Forms 6.0 a stored procedure which I made in Oracle 8i ?
    null

    This is an example from Forms on-line help "Invoking a stored program" topic:
    DECLARE
    ld DATE;
    ln NUMBER;
    lv VARCHAR2(30);
    BEGIN
    ** Calling Database Procedure/Function
    database_procedure_name(ld,ln,lv);
    ld := database_function_name(ln,lv);
    END;
    Helena

  • Calling a stored workspace procedure/function in page template

    I have an unusual puzzle. I am trying to find a way to call a stored procedure or function in a page template; ie, through HTML/javascript.
    I maintain a website with several dozen applications and I currently have the page templates in all of these applications subscribed to one master template, so that changes can be made in one place and implemented across all the applications. So far, the only content I can display on every page in every application through page template subscription is static content; dynamic content (ie content generated based on data in the database) is implemented page-by-page (or application-by-application).
    I'm wondering if there is a way to call stored procedures/functions from the page template to create dynamic content (based on the :APP_USER identity, for example). htmldb_Get() doesn't seem to be helpful, because as far as I can tell it only calls on-demand application processes, not workspace procedures/functions.
    Is there any way at all that a workspace procedure/function can be called directly from the page template (eg with a javascript function of some kind)? Again, I am trying to avoid having to use any application/page-level apex entities (items, processes, etc) so that I can just put the javascript or whatever in the page template and refresh all the applications in my workspace.
    Thanks in advance!
    Jonathan Cole
    PS - I am currently using v3.1

    Just to add the owner in output :
    SCOTT@demo102> ed
    Wrote file afiedt.buf
      1  select owner, table_name, ltrim(max(sys_connect_by_path(column_name,','))
      2                     keep (dense_rank last order by position),',') as PKcolumns
      3  from
      4  (select a.owner, a.table_name, b.column_name, b.position
      5   from all_tables a, all_cons_columns b, all_constraints c
      6   where a.owner=b.owner
      7   and   a.table_name=b.table_name
      8   and   b.owner=c.owner
      9   and   b.constraint_name=c.constraint_name
    10   and   c.constraint_type='P'
    11   and   a.table_name in ('SDO_COORD_AXES','EMP'))
    12  group by owner, table_name
    13  connect by prior owner = owner and prior table_name = table_name and prior position = position - 1
    14* start with position = 1
    SCOTT@demo102> /
    OWNER                          TABLE_NAME                      PKCOLUMNS
    MDSYS                          SDO_COORD_AXES                  COORD_SYS_ID,ORDER
    SCOTT                          EMP                             EMPNO
    SCOTT@demo102> Nicolas.

  • Oracle Form Personalization Execute Procedure Passing Multiple Parameters

    Hello,
    I am calling database procedure into the Form Personlization, I am getting please have a look into the following Syntax.
    Oracle 11i
    ='BEGIN
    XX_P_PA_UPDATE_TASKS('''||${item.TASKS.TASK_ID.value}||''','''||${item.TASKS.PROJECT_ID.value}||''' ,'''||${item.TASKS.BILLABLE_FLAG.value}||''';
    END;'
    Thanks
    Ed

    I found the Error, The error is at the End, extra PIPE Sign. But Procedure is still not calling, how to find out that procedure execute.
    ='BEGIN
    XX_P_PA_UPDATE_TASKS('''||${item.TASKS.TASK_ID.value}||''','''||${item.TASKS.PROJECT_ID.value}||''' ,'''||${item.TASKS.BILLABLE_FLAG.value}''';
    END;'

  • Forms Personalization using DB function

    Hi,
    In Shipping transaction form If the shipping quantity is more than ATR quantity then I have to show a message box.
    I created a DB function using inv_quantity_tree_pub.query_quantities API to get ATR quantity. for this function item number and organization code is the two in parameters and it returns ATR quantity.
    I used this function in forms personalization.
    Trigger Event - WHEN-VALIDATE-RECORD
    Trigger Object - DVLB
    Condition - :DLVB.SHIPPED_QUANTITY<= ATR_QTY(:DLVB.ITEM_NAME,:DLVB.ORGANIZATION_CODE)
    Processing Mode - Both
    Level - Responsibility
    Message - Shipping quantity is more than ATR quantity.
    I created the above but it is not showing any message or error. I don't know what I missed.
    Thanks in advace for your help.

    922627 wrote:
    Hi,
    In Shipping transaction form If the shipping quantity is more than ATR quantity then I have to show a message box.
    I created a DB function using inv_quantity_tree_pub.query_quantities API to get ATR quantity. for this function item number and organization code is the two in parameters and it returns ATR quantity.
    I used this function in forms personalization.
    Trigger Event - WHEN-VALIDATE-RECORD
    Trigger Object - DVLB
    Condition - :DLVB.SHIPPED_QUANTITY<= ATR_QTY(:DLVB.ITEM_NAME,:DLVB.ORGANIZATION_CODE)
    Processing Mode - Both
    Level - Responsibility
    Message - Shipping quantity is more than ATR quantity.
    I created the above but it is not showing any message or error. I don't know what I missed.
    Thanks in advace for your help.Please see if these docs help.
    How To Use Custom PL/SQL API In Forms Personalization? [ID 456407.1]
    OM: Sample Codes For Form Personalization In Order Management [ID 1266606.1]
    Thanks,
    Hussein

Maybe you are looking for