Pages

OracleEBSpro is purely for knowledge sharing and learning purpose, with the main focus on Oracle E-Business Suite Product and other related Oracle Technologies.

I'm NOT responsible for any damages in whatever form caused by the usage of the content of this blog.

I share my Oracle knowledge through this blog. All my posts in this blog are based on my experience, reading oracle websites, books, forums and other blogs. I invite people to read and suggest ways to improve this blog.


Showing posts with label Form Builder. Show all posts
Showing posts with label Form Builder. Show all posts

Friday, March 28, 2014

A New Custom Form in Oracle Apps

In this training article (for the readers of http://getappstraining.blogspot.com ), we will learn the steps needed to develop a custom Oracle Apps form from the very scratch.

In the previous chapter we learnt "how to customize an existing oracle delivered form"

Question: Why bother teaching this when Oracle fusion is destined to replace oracle forms by OA Framework?
Answer: Well firstly I am yet to hear an official word from Oracle in this regard, but  I agree it is highly likely that fusion will se demise of Oracle Forms. However more importantly Oracle will support current tech stack indefinitely, I.e Release 12 will be supported for foreseen time as per Apps Unlimited statement. Hence, many of the clients will keep using this technology for decades. Yes, I won't bother my kid learning Oracle form though. 


Question : Ok, what are the steps for building a screen from scratch?
Answer: Below steps in brief
A) Open up TEMPLATE.fmb, and save this as XXHELLOAPPS.fmb
B) Create a new window, by right clicking on Window/new
Name this window as XXHELLOAPPS,and assign it SubClass Type “WINDOW” from picklist.
C) Create a new canvas and name it XXHELLOAPPS , ensuring its Sublcass Type is “Content”
D) Make the windows property reference canvas XXHELLOAPPS and vice versa make the canvas reference windows XXHELLOAPPS.
E) Now create a block named XXHELLOAPPS . Lets keep this a control block for simplicity.
F) go to form level property, and set first navigation block to XXHELLOAPPS. 
G) Add a label and a field named “Hello_World” to this block.
    Go to pre-form to specify the new window and also the new blcok name in When-New-Form-Instance triggers.
   Open the program unit app_stand_window package body and the change the name of the window in Close_Window procedure.

H) Generate the form on PC using Control-T keystrokes. This will ensure that nothing critical has been missed out.
I)  FTP the form file to $XXPO_TOP/forms/US
Surely, this XX will be replaced by the naming convention at your client/company.
J)  cd to  $XXPO_TOP/forms/US
And f60gen on XXHELLOAPPS.fmb
This will create a file executable as XXHELLOAPPS.fmx
K) Go to Application Developer responsibility
Menu /applicaton/form
Register the form
L) Register the Forms Function
Have you read he article form functions[http://getappstraining.blogspot.com/2006/10/oracle-forms-functions-menus-and-their.html] yet?
This forms function must be registered against application "XX Purchasing".
M) Now add a menu item so that this forms function becomes available to specific responsibility.

Thats it, you will be able to open up this form from the responsibility.

Now some important notes:-
1. If you have a table based block, and if that block has some description type fields, then try not to fetch them from post query trigger. Instead, develop a view in apps schema and assign that view as base tale to this block. This has a benefit that users will be able to query on the description field if need be. Indeed you will need to do dml on the actual table yourself by overriding on-insert, on-update, on-delete and on-lock triggers.
2. For each block in the screen, create a form level package spec and package body. Your triggers in the block/block fields will make calls to that package.
3. Try not to do to much pl/sql within the form. Always do such database intensive operations in a database level package.
4. Try not using global variables, unless really needed. Give preference to the creation of form package variables.
5. In a multi record block, always add a field for Current Record Indicator.

Please let me know if anything is unclear. Feel free to ask your questions.
References:
http://oracle.anilpassi.com/a-new-custom-form-in-oracle-apps.html

Tuesday, April 23, 2013

Sub Functions In Oracle Applications


Overview:
There are two types of functions: form functions, and non-form functions. For clarity, we refer to a form function as a form, and a non-form function as a
sub

function
, even though both are just instances of functions in the database.
Oracle Applications aggregates several related business functions into a single form. But all users should not have access to every business function in a form; Oracle Applications provides the ability to identify pieces of applications logic as sub
functions. When part of an application’s functionality is identified as a sub
functions, it can be secured (i.e., included or excluded from a responsibility).


Sub function (Non-Form Function):
A non-form function (sub function) is a securable subset of a form’s functionality. Sub functions are frequently associated with buttons or other graphical elements on forms. For example, when a sub function is created for a button in a form and if the created sub function is added to the particular responsibility, then only the corresponding button will be enabled in that responsibility, otherwise (if the created sub function is not added to responsibility) the button is disabled, even if the main function is added to that responsibility, and the user will not be able to access the button.
The user can access the main function but not the sub function, if the sub function is not added to the responsibility, which means we can provide security to the part of the form functionality, using the function security mechanism through the sub function.

Diagrammatic illustration of the sub functions:

Steps to implement a Sub function in a form:
1: Open Template.fmb using Oracle form builder, save it with another name(XX_SUB_FUNC.fmb) and give the module name as “XX_SUB_FUNC”.
















2: Delete the following:
“BLOCKNAME” from Canvas and Data Block
“DETAILBLOCK” from Data Block
“BLOCKNAME” from Window.










3:Create window (XX_SUB_WIN), apply subclass information as “WINDOW” and give the title.




















4: Give this window name in PRE-FORM trigger (Form Level) and also in APP_CUSTOM body from Program_Unit (in place of window name).



















Give this window name in PRE-FORM trigger (Form Level) As Shown below





















Give this window name in APP_CUSTOM (PACKAGE BODY) as below
























5:Create New Canvas





















6: Now create a new Data block (EMP) using Wizard or Manual, apply subclass information to the block as “BLOCK” and also apply subclass information to the items as “TEXT_ITEM”.





































































Click on Finish…………..until finish




















7: Give the Subclass information for Block (EMP) As BLOCK





















8: Create a Button(EXIT) in Canvas and write your required functionality code in when button pressed trigger.


















9: Give the Subclass information for ITEM (EMPNO) as TEXT_ITEM




















10: Finally move your form from our Local Machine to CUSTOM_TOP using WINSCP or any of your local tools.





















11: Compile the Form using “f60gen”

In the UNIX environment, type the following command:

f60gen XX_SUB_FUNC.fmb apps/apps







































12: Connect to Oracle Applications:
1. Create a Form (Navigation: Application Developer->Application-> Form)
Here give the following details and save the details.
Form =>XX_SUB_FUNC (.fmx )
Application => xxmz Custom(Custom TOP Application)
User Form Name=>Give any name

2. Create a function (Navigation: Application->function)

Here give the following details:

Description Tab:
Function name: Any Name (XX_SUB_FUNC_FUNC)
User Function Name: Any Name (XX_SUB_FUNC_FUNC)




Properties Tab:
Type: Form
Maintenance Mode Support: None
Context Dependence: Responsibility



Form Tab:

Attach User Form Name:XX_SUB_FUNC







Create Sub Function (XX_SUB_FUNC_FUNC1) below the main function
(Navigation: Application Developer=>Application=>Function)
Give the User Function Name: XX_SUB_FUNC_FUNC: EXIT (User function name: button name)


Properties Tab:

Type: Sub function
Maintenance Mode Support: None
Context Dependence: Responsibility









13: Once again Switch to Form builder open the user form and go to Form Level Trigger
“WHEN_NEW_FORM_INSTANCE” and incorporate the function



















14: Write the Function ( Function name=>fnd_function.test) As
Script:
if fnd_function.test(‘XX_SUB_FUNC_FUNC1′)then
set_item_property(‘emp.exit’,ENABLED<PROPERTY_TRUE):
else
set_item_property(‘emp.exit’,ENABLED,PROPERTY_FALSE);
END IF;















15: Save it and move the form to custom top using WINSCP like tools and compile the form again












































16: Switch to Oracle application:


Switch to Menu
(Navigation: Application Developer=>Application=>Menu)

Attach Main function to the Custom TOP menu
User function name: XX_SUB_FUNC_FUNC



Switch to Custom Application Responsibility (XXMZ CUSTOM)



Execute the Function (Click on the Function name)
(Function name=>sub functions)





The button will be disabled (because the sub function is added for the button and sub function is not added to the custom menu)

















Switch to Application Developer Responsibility









Attach Sub function to the Custom TOP menu without giving prompt.
User sub function name: XX_SUB_FUNC_FUNC: EXIT




Again Switch Custom Application Responsibility(XXMZ CUSTOM)





Click on Function name (sub functions)


The button will be enabled (because the sub function is added to the button and also to the custom menu)