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
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
Elsif :parameter.invoice_mode='CLERK' then
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.