Friday, October 20, 2006

Oracle Forms Functions Menus and their relationship

Every screen we develop delivers a business functionality of sorts. Notice the word functionality.
Hence the word function or call it "Form Function" is related to Oracle Forms.

You all know that a form is nothing but a screen from where users can enter or retrieve(query) existing data.

Qns: In Oracle why do we have a form and then also a Form Function? Isn't just having a Screen/Form just good enough?
Ans: What if, for the same form, you wish to provide slightly different functionalities depending upon which menu is clicked to invoke that form??

Question: Are there any examples?
Answer: Lets assume the following

There are two responsibilities
------------------------------
Payables Manager responsibility
Payables clerk responsibility

There is one form for invoices
------------------------------
Payables invoice screen

Our requirement
-------------------------------
If invoice screen is invoked from Payables Manager Responsibility, then at startup of the screen we want to provide a "Search Window", so that manager can search for the invoices to review

If the invoice screen is invoked from "Payables Clerk Responsibility", then at startup of the screen we want to provide "Invoice Data Entry window", so that clerk can begin entering the invoices.

The form will have following code within it in when-new-form-instance.
If :parameter.invoice_mode='MANAGER' then
Go_block(lfind_invoices')
Elsif :parameter.invoice_mode='CLERK' then
GO_BLOCK('invoice_header'),
End if;

Question: From above example it appears that form function will be passing parameter named invoice_mode to the form?
Answer. Correct in this case.
So that we understand how things hang together.
Invoice form is attached to a Form Function, when defining the Form Function we pass parameters to it. Then this Form Function is attached to the Menu, and it is the Menu that gets attached to responsibility.

Question : Oh dear,are the form functions all about parameters?
Answer: Parameters is the main feature of Form Functions. But there are others too.
As you know from previous training lessons, each form will be located in a specific directory on Unix box. For example, Purchasing Form executables will be in $PO_TOP/foms/US
And account payables form executables will be located in $AP_TOP/forms/US.

Did you wonder how Oracle will know to look for a payables form executable in AP_TOP and not in PO_TOP??
Oracle will think like this...hmm user clicked on a menu, what is the form function for this menu...hmm it is InvoiceReview....ok...what is the application assigned to the for form function...oh...its ap(account payables) application...right....what is the base path for this application...rite..it is AP_TOP...lets then run the fmx file from ap_top/forms/us


Screenshots for examples
A. Go to application developer click on menu /application/form
Define you form...remember, oracle will expect an executable of .fmx for this name

Click on menu /application/function
Define your two functions, invoice review, invoice entry, pass them parameters as below.

Login to Oracle Apps , and select responsibility "Application Developer"
Navigate the menu "Form"
Define the Form as below
Now, lets define the function







Do you wish to know the name of form that has approx 600 functions defined in oracle apps? To find the answer, click on interview questions link.

24 comments:

  1. Anonymous1:55 AM

    Hi Anil,
    thanks for the article. i have followed the way you mentioned to create a form function parameter. i defined a parameter called scanname in my form.(scanname="coh") and when i try to access the parameter from my form(:parameter.scanname='coh') i get an error message-bad bind variable parameter.scanname not found. i think the form parameter cannot be accessed from my desktop.it displays same error message on my unix box as well. what should i need to do? any help will be highly appreciated.
    cheers
    kumar

    ReplyDelete
  2. Anonymous1:26 AM

    Excellet article.. Thanks anil

    ReplyDelete
  3. that was very helpful indeed, there was so much clarity in explanation... thanks a lot.

    ReplyDelete
  4. Anonymous2:40 AM

    hii i cannot understand proper that what is responsibiliy and
    the relation detweent
    responsibility
    |
    _____
    | | |
    menu request data group

    ReplyDelete
  5. hii i cannot understand proper that what is responsibiliy and
    the relation detweent
    responsibility
    |
    _____
    | | |
    menu request data group

    ReplyDelete
  6. Hi Anil,
    How do i know what all parameters are available for a specific form? In your example of invoice from, is mode a supplied parameter and the when-new-form-isntance trigger has this code in built? or do i need to go in and write this?

    Thanks,
    Bhavesh

    ReplyDelete
  7. Hi Anil. Congrats for your great articles. I have a question......
    As we are using Oracle Apps functions and tabs in our OAF application to redirect between different pages. Is it possible to use functions to refresh a particular regions (i dont want my page to be reload again) inside a page?

    ReplyDelete
  8. Anonymous5:10 AM

    Hi Anil,
    thanks for providing useful materials.
    i developed a form, o/p shd display empno,ename.
    empno having lov.

    first i have created record grp manually as below:
    ITEM:Empno
    TRIGGER:When-New-Item-Instance

    declare
    rg_name varchar2(30):='XRECGRP';
    rg_id recordgroup;
    errcode number;
    begin
    rg_id:=find_group(rg_name);
    if id_null(rg_id) then
    rg_id:=create_group_from_query (rg_name,'select empno from emp');
    end if;
    ERRCODE:=POPULATE_GROUP (RG_ID);
    end;


    next i created lov at design time(option:manually).
    (i didn't change any property)

    in same above code i changed as
    declare
    lov_result boolean;
    rg_name varchar2(30):='XRECGRP';
    rg_id recordgroup;
    errcode number;
    begin
    rg_id:=find_group(rg_name);
    if id_null(rg_id) then
    rg_id:=create_group_from_query(rg_name,'select empno from emp');
    end if;
    ERRCODE:=POPULATE_GROUP(RG_ID);
    set_lov_property ('lov',GROUP_NAME,'XRECGRP');
    lov_result:=show_lov('lov8');
    end;

    it showing errror as:
    FRM-30048: Unable to find record group .
    LOV LOV8
    Form: XFORM_RGRP_LOV
    FRM-30085: Unable to adjust form for output.

    In Code i have attach record grp to lov(using set_lov_property) why its not taking.

    if that lov already consists another record grp then it is setting rec grp used in set_lov_property.i don't want like that.plz ans me.
    and is there any way to create lov manually(using code) or we have create at design time only(using create button)

    ReplyDelete
  9. hi can you please let me know whether the function can be coped

    ReplyDelete
  10. You can copy the function to create a new function.
    But you will have to either attach that to a Menu or you have to invoke the new Function via fnd_function.execute.

    Thanks,
    Anil Passi

    ReplyDelete
  11. Anonymous7:54 PM

    Its really nice artical...

    Thanks Anil..

    ReplyDelete
  12. Anonymous11:44 PM

    Can we attach two forms to one Form function?






    Thanks,
    Ramireddy

    ReplyDelete
  13. You can create Many functions for 1 Form.

    But one Function can't have two forms

    Thanks
    Anil

    ReplyDelete
  14. Hi all!
    can u help me. i am new to oracle form and report designer. i want to develop some basic to complicated forms and reports. so i want some examples which i can download .
    regards

    ReplyDelete
  15. Anonymous10:52 AM

    Dear Anil,
    Please give some knowledge about menu customization. what it is done and how it be used?

    Suman

    ReplyDelete
  16. Anonymous10:07 PM

    Thnx anil !

    I am surching for the same
    and u gave me the solution

    MKK

    ReplyDelete
  17. Hi,
    I am new to Oracle E-Business Suite (ERP). Can one one hlep me for Cartion of PArt, BOM, Resources, Routing etc. If possible send me setp by step screenshots.
    Thanks
    Shripad

    ReplyDelete
  18. Hi,
    I am new to Oracle E-Business Suite(ERP). Can some one hlep me for Creation of Part, BOM, Resources, Routing etc. If possible send me step by step screenshots.
    Thanks
    Shripad

    ReplyDelete
  19. Anonymous4:46 PM

    Thanks Anil.

    ReplyDelete
  20. Anonymous4:10 AM

    Good Anil.... Easy demonstration... one can learn easily... Put same kind of articles on R12

    ReplyDelete
  21. Hi All,
    I am having a requiremnt in which the custom form that is developed shoulbe opened from horizontal tool bar of standard tool bar menu of the order entry form.
    navigation is tools --->custom form-->open

    can any one tell me how to achieve this.

    ReplyDelete
  22. Anonymous1:48 AM

    U r best

    ReplyDelete
  23. Anonymous12:21 PM

    awesome Dear Mr.anil Really We thakful to you for the sharing of your knowledge and time.Really good and great man.i am the fan of you.

    ReplyDelete