ebs3-custom applications integration

Upload: appsloader

Post on 03-Apr-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 EBS3-Custom Applications Integration

    1/78

    www.ConfluentMinds.com

    Oracle Apps Standard for

    Forms

  • 7/28/2019 EBS3-Custom Applications Integration

    2/78

    www.ConfluentMinds.com

    Agenda Template Form

    Custom Library

    APPCORE APIs

    FNDSQF APIs

    Coding the Handlers

    Oracle Apps standard for Form widgetproperties

    PL/SQL APIs for Concurrent Processing Message Dictionary

    Forms Personalization

  • 7/28/2019 EBS3-Custom Applications Integration

    3/78

    www.ConfluentMinds.com

    Template Form

  • 7/28/2019 EBS3-Custom Applications Integration

    4/78

    www.ConfluentMinds.com

    Objectives Build new forms as per Oracle Applications standard

    Customize existing forms in Oracle Applications

  • 7/28/2019 EBS3-Custom Applications Integration

    5/78

    www.ConfluentMinds.com

    The Template Form is the required as starting point forthe development of all new forms in the Oracle Apps

    Copy the standard template file TEMPLATE.fmb from$AU_TOP/forms/US directory to your local directory.

    Copy the form APPSTAND.fmb from$AU_TOP/forms/US directory to your local directory.This FMB is essential to work on TEMPLATE.fmb astemplate objects are derived from this standard form.

    Rename the TEMPLATE.fmb to some other namedepending on the application to be developed.

    The Template form uses many libraries for variouspurposes as described later. Get all those librariesavailable under $AU_TOP/resource directory.

    The below command in ftp allows you to mget multiplefiles without asking for confirmation.. ftp> prompt no

    In Putty psftp, mgetr *.* will suppress the confirmationprompts.

    The windows directory where you got all such files mustbe in FORMS_PATH. Go to Start-> Run-> regedit andsearch for values as FORMS_PATH.

    Now open the Template form which will open withouterror and you can compile it as it is.

    The Template Form

  • 7/28/2019 EBS3-Custom Applications Integration

    6/78

    www.ConfluentMinds.com

    Remove the existing MASTER and DETAIL (BLOCKNAMEand DETAILBLOCK) blocks from the form. Also remove the

    canvas and window associated to these blocks(BLOCKNAME). Do not remove any other standard objectsfrom the form.

    Create your own blocks, Canvases, Windows and otherrelated Objects depending upon the application requirement.

    The first navigable block should be any one of the block thatyou have developed.You can specify it in the property sheetof the form.

    You need to modify the Program Unit namedAPPS_CUSTOM so as to ensure that application can switchbetween windows perfectly. The names of windows has to bespecified properly here.

    You need to modify the trigger PRE-FORM. Specify the nameof the window which contains your first navigable block

    Make use of standard property class, visual attributes etc to

    get the standard look and Feel of Oracle applications screenfor your customized forms. Compile the form , save and ftp to the server. You need to

    generate the fmb file in the server using .. $ f60gen module=XXPOSCREEN.fmb userid=apps/apps

    module_type =form batch=no The generated .fmx file need to be put into proper path now.

    The Template Form (Contd.).

  • 7/28/2019 EBS3-Custom Applications Integration

    7/78

    www.ConfluentMinds.com

    Platformindependent attachment of several libraries to theTemplate form are

    1. FNDSQF -- For Message Dictionary, Flexfields, Profiles,Concurrent processing and utilities for navigation, multi-currency, WHO etc

    2. APPCORE -- For all the forms to support the Menu,Toolbar and other standard behaviors and utilities forexception handling, message levels etc

    3. APPDAYPK -- For control the Oracle Applications Calendarfeatures

    4. CUSTOM -- For features like Zoom, enforcing businessrules, etc.

    5. GLOBE -- Allows the developers to incorporate global orregional features into Oracle Applications withoutmodification of the base Oracle Applications Form (This callsroutines in JA, JE, JL libraries based on some events)

    6. JA -- contains code specific to Asia/Pacific region

    7. JE -- contains code specific to Europe/Middle East/Africa8. JL -- contains code specific to Latin America9. VERT -- Allows Oracle Apps developers to incorporate

    vertical industry features (for automotive, consumerpackaged goods, energy, and other industries) into Oracle

    Apps forms without modification of the base form.

    Attached Libraries

  • 7/28/2019 EBS3-Custom Applications Integration

    8/78

    www.ConfluentMinds.com

    The Template Form contains Platformindependentreferences to object groups in the APPSTAND formviz:

    1. STANDARD_PC_AND_VA

    2. STANDARD_TOOLBAR

    3. STANDARD_CALENDAR

    4. QUERY_FIND

    Reference Objects

  • 7/28/2019 EBS3-Custom Applications Integration

    9/78

    www.ConfluentMinds.com

    APP_CUSTOM package APP_CUSTOM Package contains default behaviors of window opening and closing

    events. You need to modify and put appropriate window names.

    Close_window program ..

    if (wnd = '') then

    app_window.close_first_window;

    elsif (wnd = '') then

    --defer relations

    --close related windows

    null;

    elsif (wnd = '') then

    --defer relations

    --close related windows

    null;

    end if;

  • 7/28/2019 EBS3-Custom Applications Integration

    10/78

    www.ConfluentMinds.com

    Custom(.pll) Library

  • 7/28/2019 EBS3-Custom Applications Integration

    11/78

    www.ConfluentMinds.com

    Custom Library The CUSTOM.pll library is a standard Oracle Forms PL/SQL library that is supplied

    with the Oracle Applications which allows the customer to enhance the standardfunctionality in Oracle Forms -based eBusiness screen.

    CUSTOM library is a Forms PL/SQL library, it can include standard PL/SQL logic,Oracle Forms built-in commands and may have other Forms PL/SQL librariesattached to it. The base CUSTOM library is located in the $AU_TOP/resourcedirectory on your forms server.

    This makes an ideal point of creating business rules that effect the entire

    organization.

  • 7/28/2019 EBS3-Custom Applications Integration

    12/78

    www.ConfluentMinds.com

    Custom Library Business rules can be enforced by adding logic that will be executed when a user

    attempts to save a record. The business rules can be as simple as determining that a

    user has the authority to perform the actions or that certain data has been entered oras complex as limiting field access and display based upon a users security level. Allof these items can be coded using PL/SQL logic and Forms built-in features. Sincethe CUSTOM library cannot contain SQL commands, that type of logic must bepassed off to stored procedures or functions within the Oracle database.

    This section of code looks for the event WHEN-NEW-FORM-INSTANCE when theuser is in the PO Supplier form (APXVDMVD).

    IF event_name = 'WHEN-NEW -FORM-INSTANCE' THEN

    If (form_name = 'APXVDMVD') THEN

    v_user_id := fnd_global.user_id;

    v_site_maint_ok := FMS_USER_HAS_RESP(v_user_id, 'Purchasing Vendor Site Maint');

    If (block_name = 'SITE' ) THEN

    FMS_WHEN_NEW_ITEM_SITE(v_site_maint_ok, v_new_record);

    End if; -- BLOCK=SITE

    End If; -- FORM=APXVDMVD

    END IF;

  • 7/28/2019 EBS3-Custom Applications Integration

    13/78

    www.ConfluentMinds.com

    Custom Library Once enhancements are implemented, the CUSTOM library is accessed by the

    Oracle Applications based upon events. The events define the occasions when the

    Applications will look into the CUSTOM library for additional code to execute.

    Some events are generic:

    WHEN-NEW-FORM-INSTANCE initially entering a form

    WHEN-NEW-BLOCK-INSTANCE entering a zone (or block) within a form

    WHEN-NEW-ITEM-INSTANCE moving into a new field within the form

    WHEN-NEW-RECORD-INSTANCE - creating a new record WHEN-FORM-NAVIGATE navigating thru a form using the mouse

    WHEN-VALIDATE-RECORD saving (committing) the information to the database

    EXPORT triggered by using the Export feature

    Some events are field specific

    ZOOM Pre -11 feature for moving to another form and querying up specific records.

  • 7/28/2019 EBS3-Custom Applications Integration

    14/78

    www.ConfluentMinds.com

    Custom LibrarySome events are form specific

    SPECIALn - (where n is a number between 1 and 45) used to generate entries in theSpecial menu of the tool bar and the code is triggered by selecting a menu choicesfrom the Special option on the toolbar

    KEY-Fn (where n is a number between 1 and 8) triggered by pressing thecorresponding function key

  • 7/28/2019 EBS3-Custom Applications Integration

    15/78

    www.ConfluentMinds.com

    Custom Library Once any enhancements are made, the library must be generated into an executable

    library (CUSTOM.plx) that then can be used by the Oracle Applications Formsruntime module. Since the CUSTOM library is loaded once for a given session, a usermust log out of the application and sign-on again before any changes will becomeapparent. It is suggested that you also place a copy of the CUSTOM library in yourcustomization directory as a safety precaution. The CUSTOM PL/SQL library doeshave its limitations. It can not contain SQL commands. It can not have certain

    Oracle Applications Forms global libraries attached to it (such as APPCORE). The

    CUSTOM library is designed to be used solely with the Oracle eBusinessApplications and does not support the Oracle Self-Service Web Applications(OSSWA). Since the CUSTOM librarys standard location is in the

    $AU_TOP/resource, it can be overwritten during an upgrade of the Applications.

  • 7/28/2019 EBS3-Custom Applications Integration

    16/78

    www.ConfluentMinds.com

    PACKAGE BODY custom IS Customize this package to provide specific responses to

    events within Oracle Applications forms. Do not change the specification of the CUSTOM package in any way.function zoom_available return BOOLEAN is

    This function allows you to specify if zooms exist for the current context. If zooms are available for this block, then return TRUE; else return FALSE. This routine is called on a perblock basis within every Applications form. Therefore, any code that will enable Zoom must test the current

    form and block from which the call is being made. By default this routine must return FALSE.

    Custom Library

  • 7/28/2019 EBS3-Custom Applications Integration

    17/78

    www.ConfluentMinds.com

    form_name varchar2(30) := name_in(system.current_form);block_name varchar2(30) := name_in(system.cursor_block);beginif (form_name = DEMXXEOR and block_name = ORDERS) thenreturn TRUE;elsereturn FALSE;end if;

    end zoom_available;function style(event_name varchar2) return integer is

    This Zoom example does not do anything to the STYLE functionbeginreturn custom.standard;

    end style;

    Custom Library

  • 7/28/2019 EBS3-Custom Applications Integration

    18/78

    www.ConfluentMinds.com

    procedure event(event_name varchar2) is

    This procedure allows you to execute your code at specific

    events. ZOOM or productspecific events will be passed

    in event_name. See the Applications Technical Reference

    manuals for a list of events that are available through

    this interface.

    form_name varchar2(30) := name_in(system.current_form);

    block_name varchar2(30) := name_in(system.cursor_block);

    param_to_pass1 varchar2(255);

    param_to_pass2 varchar2(255);

    BEGIN

    if (event_name = ZOOM) then

    if (form_name = DEMXXEOR and block_name = ORDERS)

    then

    param_to_pass1 := name_in(ORDERS.order_id);

    param_to_pass2 := name_in(ORDERS.customer_name);

    Custom Library

  • 7/28/2019 EBS3-Custom Applications Integration

    19/78

    www.ConfluentMinds.com

    /* use fnd_function.execute instead of open_form */

    FND_FUNCTION.EXECUTE(FUNCTION_NAME=>DEM_DEMXXEOR,

    OPEN_FLAG=>Y,

    SESSION_FLAG=>Y,

    OTHER_PARAMS=>

    ORDER_ID=||param_to_pass1||

    CUSTOMER_NAME=||

    param_to_pass2||);

    /* all the extra single and double quotes account for

    any spaces that might be in the passed values */

    end if;

    else

    null;

    end if;

    end event;

    END custom;

    Custom Library

  • 7/28/2019 EBS3-Custom Applications Integration

    20/78

    www.ConfluentMinds.com

    APPCORE APIs

  • 7/28/2019 EBS3-Custom Applications Integration

    21/78

    www.ConfluentMinds.com

    APP_EXCEPTION.RAISE_EXCEPTION

    This procedure stores exception information and raises exception

    form_trigger_failure. Syntax:

    procedure APP_EXCEPTION.RAISE_EXCEPTION(

    exception_type varchar2 default null,

    exception_code number default null,

    exception_text varchar2 default null);

    Parameters:

    exception_type : Error prefix that specifies error type (eg.ORA or APP)

    exception_type : The number that identifies the error.

  • 7/28/2019 EBS3-Custom Applications Integration

    22/78

    www.ConfluentMinds.com

    APP_ITEM_PROPERTY.SET_PROPERTY

    This procedure sets the property of an item. You should never use

    the Oracle Forms builtin SET_ITEM_PROPERTY to set the fieldproperties

    Syntax:

    procedure APP_ITEM_PROPERTY.SET_PROPERTY(

    item_id item, property varchar2,value number);

    Parameters:Property : DISPLAYED, ENABLED, ENTERABLE, ALTERABLE,

    INSERT_ALLOWED, UPDATEABLE, NAVIGABLE, REQUIRED etc..APP_ITEM_PROPERTY.SET_PROPERTY remaps some properties todo other things like change visual attributes. Also, there are someproperties that APP_ITEM_PROPERTY provides that native OracleForms does not.

    Value: Look AOL documentation for value

  • 7/28/2019 EBS3-Custom Applications Integration

    23/78

    www.ConfluentMinds.com

    FND_FUNCTION.EXECUTE Executes the specified form function. Only executes functions that

    have a form attached. Displays a message to the end user if thefunction is not accessible.

    Make sure that the function is defined with Oracle Application Object

    Library. Also, the function must be somewhere on the menu for the

    Syntax:

    procedure FND_FUNCTION.EXECUTE(function_name IN varchar2,

    open_flag IN varchar2 default Y,

    session_flag IN varchar2 default SESSION,

    other_params IN varchar2 default NULL,

    activate IN varchar2 default ACTIVATE,

    browser_target IN varchar2 default NULL);

  • 7/28/2019 EBS3-Custom Applications Integration

    24/78

    www.ConfluentMinds.com

    APPCORE APIs contd.. APP_EXCEPTION.RETRIEVE

    This procedure retrieves exception information from the database. APP_EXCEPTION.DISABLED

    This procedure rings the bell. Call this procedure to disable simple

    functions (typically in a KEY trigger).

    APP_ITEM_PROPERTY.GET_PROPERTY

    function APP_ITEM_PROPERTY.GET_PROPERTY(

    item_id item,

    property number)

    return number;

    procedure APP_RECORD.HIGHLIGHT(value varchar2);

    This call changes the visual attribute of the current record by calling theDISPLAY_ITEM builtin.To highlight data, pass SELECTED_DATA. Toturn off highlighting, pass DATA. You can pass the name of any visual

    attribute you want to apply.

  • 7/28/2019 EBS3-Custom Applications Integration

    25/78

    www.ConfluentMinds.com

    APPCORE APIsAPP_STANDARD.APP_VALIDATE

    procedure APP_STANDARD.APP_VALIDATE (scope NUMBER);This procedure acts similarly to Oracle Forms builtin Validate, except

    that it navigates to the first item that caused the validation failure, and

    it provides support for the button standard. Use it instead of the

    Oracle Forms builtin.

    The scope of the validation. Valid values are

    DEFAULT_SCOPE, FORM_SCOPE,

    BLOCK_SCOPE, RECORD_SCOPE, and

    ITEM_SCOPE.

  • 7/28/2019 EBS3-Custom Applications Integration

    26/78

    www.ConfluentMinds.com

    APPCORE APIsprocedure APP_STANDARD.SYNCHRONIZE;

    Dynamic changes to the form can affect which menu items apply,although the state of the menu items is not reevaluated automatically.

    If you make a change that affects which items in the toolbar and menu

    can be used, call this routine, and it reevaluates the menu and toolbar.

    (For example, changing the INSERTABLE property of a block,changing the status of a record, etc.)

  • 7/28/2019 EBS3-Custom Applications Integration

    27/78

    www.ConfluentMinds.com

    APPCORE APIsAPP_WINDOW.CLOSE_FIRST_WINDOW

    procedure APP_WINDOW.CLOSE_FIRST_WINDOW;This call exits the form. It raises FORM_TRIGGER_FAILURE if it fails.

    APP_WINDOW.SET_COORDINATION

    procedure APP_WINDOW.SET_COORDINATION(

    event varchar2,

    coordination varchar2,

    relation_name varchar2);

    This call sets the deferred coordination attribute of a relation to ON or

    OFF based on the state of the coordination check box. The checkbox is either DEFERRED or IMMEDIATE.

  • 7/28/2019 EBS3-Custom Applications Integration

    28/78

    www.ConfluentMinds.com

    FNDSQF APIs

  • 7/28/2019 EBS3-Custom Applications Integration

    29/78

    www.ConfluentMinds.com

    FNDSQF APIsprocedure

    FND_GLOBAL.APPS_INITIALIZE(

    user_id in number,resp_id in number,

    resp_appl_id in number);

    function FND_GLOBAL.USER_ID

    return number;Returns the user ID.

    procedure FND_STANDARD.SET_WHO;

    SET_WHO loads WHO fields with properuser information. Call in PREUPDATE,

    PREINSERT for each block with WHOfields. You do not need to callFND_GLOBAL if you use SET_WHO topopulate your WHO fields.

    functionFND_STANDARD.SYSTEM_DATE returndate;This function behaves exactly like thebuiltin SYSDATE, only cachedfor efficiency. You should use it in yourOracle Forms PL/SQL code in

    place of the builtin SYSDATE.

    function FND_STANDARD.USER returnvarchar2;This function behaves exactly like thebuiltin USER, only cached for

    efficiency. You should use it in your OracleForms PL/SQL code inplace of the builtin USER.

  • 7/28/2019 EBS3-Custom Applications Integration

    30/78

    www.ConfluentMinds.com

    Coding Handlers

  • 7/28/2019 EBS3-Custom Applications Integration

    31/78

    www.ConfluentMinds.com

    Coding Item Handlers Handlers serve to centralize the code so it is easier to read and work with.

    A typical form has a package for each block, and a package for the formitself.

    Place code in procedures within these packages and call the procedures(handlers) from the associated triggers.

    You should keep code in the triggers to a minimum.

    Item handlers are procedures that contain all the logic used for validating a

    particular item. An item handler package contains all the procedures for validating the items

    in a block or form.

    The packages are usually named after their block or form, while theprocedures are named after their particular item.

    For example, the block EMP includes the items EMPNO, ENAME, and JOB.

    The corresponding package EMP contains procedures named EMPNO,ENAME, and JOB, making it easy to locate the code associated with aparticular item. An item handler always takes one parameter namedEVENT, type VARCHAR2, which is usually the name of the trigger callingthe item handler.

  • 7/28/2019 EBS3-Custom Applications Integration

    32/78

    www.ConfluentMinds.com

    Coding Table Handlers A table handler is a serverside or clientside package that provides

    an API to a table. Table handlers are used to insert, update, delete,or lock a record, or to check if a record in another table references arecord in this table.

    Since most of the forms in Oracle Applications are based on views,these table handlers are necessary to handle interactions with the

    tables underneath the views. Table handlers contain the following procedures:

    INSERT_ROW, UPDATE_ROW, DELETE_ROW, and LOCK_ROW arecommonly used to replace default Oracle Forms transaction processingin the ONINSERT, ONUPDATE, ONDELETE, and ONLOCKtriggers.

  • 7/28/2019 EBS3-Custom Applications Integration

    33/78

    www.ConfluentMinds.com

    Example Package spec you would code for your EMP block

    PACKAGE EMP IS

    PROCEDURE Insert_Row;PROCEDURE Lock_Row;

    PROCEDURE Update_Row;

    PROCEDURE Delete_Row;

    END EMP;

    Package body you would code for your EMP blockPACKAGE BODY EMP IS

    PROCEDURE Insert_Row IS

    BEGIN

    INSERT INTO EMP(

    empno,

    ename,

    ..

    ) VALUES (:EMP.Empno,

    :EMP.Ename,

    ..

    );

    END Insert_Row;

  • 7/28/2019 EBS3-Custom Applications Integration

    34/78

    www.ConfluentMinds.com

    Oracle Apps standard for Formwidget properties

  • 7/28/2019 EBS3-Custom Applications Integration

    35/78

    www.ConfluentMinds.com

    Item PropertiesIn general, most text items use the TEXT_ITEM property class.

    Use the TEXT_ITEM_DISPLAY_ONLY property class on fields that do

    not allow a user to type, but must support scrolling and or querying.

    Use the TEXT_ITEM_MULTILINE property class on all multiline text

    items.

    Use TEXT_ITEM_DATE for date fields unless the item is display only.

    Apply the CREATION_OR_LAST_UPDATE property class to the itemscontaining the WHO date information, CREATION_DATE and

    LAST_UPDATE_DATE.

    Date fields use the DATE data type unless the user needs to enter

    time. Use the DATETIME data type to require the user to enter time.To default a form field to the current date without the time, use

    $$DBDATE$$. To default a form field to the current date and time, use

    $DBDATETIME$$.

  • 7/28/2019 EBS3-Custom Applications Integration

    36/78

    www.ConfluentMinds.com

    Standard Calendar Create one text item

    Go to text item properties -> go to lov section -> set 1. Subclass information->text-item-date

    2. LOV-> enable list lamp

    3. Validate from list -> no

    3. Create one key-listval trigger for the text-item and write code as

    "calendar.show"; 4. Compile it.

  • 7/28/2019 EBS3-Custom Applications Integration

    37/78

    www.ConfluentMinds.com

    PL/SQL APIs forConcurrent Processing

  • 7/28/2019 EBS3-Custom Applications Integration

    38/78

    www.ConfluentMinds.com

    FND_REQUEST.SUBMIT_REQUEST

    Function FND_REQUEST.SUBMIT_REQUEST submits a concurrent

    request for processing by a concurrent manager. If the requestcompletes successfully, this function returns the concurrent request ID;otherwise, it returns 0.

    Syntax for Function FND_REQUEST.SUBMIT_REQUEST

    (application IN varchar2 default NULL,

    program IN varchar2 default NULL,description IN varchar2 default NULL,

    start_time IN varchar2 default NULL,

    sub_request IN boolean default FALSE

    argument1,

    argument2, ..., argument99,argument100)

    return number;

  • 7/28/2019 EBS3-Custom Applications Integration

    39/78

    www.ConfluentMinds.com

    Arguments Application : Short name of the application associated with the

    concurrent request to be submitted. Program : Short name of the concurrent program (not the

    executable) for which the request should be submitted.

    Description (Optional.)

    start_time : Time at which the request should start running,formatted

    as HH24:MI or HH24:MI:SS (Optional.) sub_request : Set to TRUE if the request is submitted from another

    request and should be treated as a subrequest

    argument1...100 : up to 100 arguments are permitted. If submittedfrom Oracle Forms, you must specify all 100 arguments.

  • 7/28/2019 EBS3-Custom Applications Integration

    40/78

    www.ConfluentMinds.com

    Exampledeclare

    req_id number;begin

    req_id := FND_REQUEST.SUBMIT_REQUEST (FND,

    FNDMDGEN, Message File Generator,

    01NOV02 00:00:00, FALSE, ...arguments...);

    if (req_id = 0) then/* Handle submission error */

    FND_MESSAGE.RETRIEVE;

    FND_MESSAGE.ERROR;

    else

    commit;end if;

    end;

  • 7/28/2019 EBS3-Custom Applications Integration

    41/78

    www.ConfluentMinds.com

    Example/* Submit a request from a form and commit*/

    :parameter.req_id :=

    FND_REQUEST.SUBMIT_REQUEST (:blockname.appsname,:blockname.program,:blockname.description,:blockname.start_time,:blockname.sub_req = Y,123, NAME_IN(ORDERS.ORDER_ID), abc,chr(0), , , , , , ,, , , , , , , , , ,, , , ,

    , , , , , ,, , , , , , , , , ,, , , , ,, , , , ,, , , , , , , , , ,, , , , , ,

    , , , ,, , , , , , , , , ,, , , , , , ,, , ,, , , , , , , , , ); IF :parameter.req_id = 0 THENFND_MESSAGE.RETRIEVE;FND_MESSAGE.ERROR;ELSEIF :SYSTEM.FORM_STATUS!= CHANGED THENIF app_form.quietcommit THEN

    /*form commits without asking user to save*/fnd_message.set_name(SQLGL,GL_REQUEST_SUBMITTED);fnd_message.set_TOKEN(REQUEST_ID,TO_CHAR(:PARAMETER.REQ_ID), FALSE);fnd_message.show;

    ELSEfnd_message.set_name(FND,CONCREQUEST SUBMISSION FAILED);fnd_message.error;END IF;ELSEDO_KEY(COMMIT_FORM);IF :SYSTEM.FORM_STATUS != CHANGED

    THEN/*commit was successful*/fnd_message.set_name(SQLGL, GL_REQUEST_SUBMITTED);fnd_message.set_TOKEN(REQUEST_ID,TO_CHAR(:PARAMETER.REQ_ID),

    FALSE);

    fnd_message.show;END IF;END IF;END IF;

  • 7/28/2019 EBS3-Custom Applications Integration

    42/78

    www.ConfluentMinds.com

    FND_REQUEST.SET_REPEAT_OPTIONS

    Optionally call before submitting a concurrent request to set repeat

    options. Returns TRUE on successful completion, and FALSEotherwise.

    function FND_REQUEST.SET_REPEAT_OPTIONS

    (repeat_time IN varchar2 default NULL,

    repeat_interval IN number default NULL,

    repeat_unit IN varchar2 default DAYS,repeat_type IN varchar2 default START

    repeat_end_time IN varchar2 default NULL)

    return boolean;

  • 7/28/2019 EBS3-Custom Applications Integration

    43/78

    www.ConfluentMinds.com

    Arguments repeat_time: Time of day to repeat the concurrent request,formatted

    as HH24:MI or HH24:MI:SS. The only other parameter you may usewith repeat_time is repeat_end_time.

    repeat_interval: Interval between resubmissions of the request. Usethis parameter along with repeat_unit to specify the time betweenresubmissions. This parameter applies only when repeat_time isNULL.

    repeat_unit: The unit of time used along with repeat_interval tospecify the time between resubmissions of the request. Theavailable units are MINUTES, HOURS, DAYS, and MONTHS.This parameter applies only when repeat_time is NULL.

    repeat_type: Determines whether to apply the resubmission intervalfrom either the START or the END of the requests execution. Thisparameter applies only when repeat_time is NULL.

    repeat_end_time: The date and time to stop resubmittingtheconcurrent request, formatted as DDMONYYYY HH24:MI:SS

  • 7/28/2019 EBS3-Custom Applications Integration

    44/78

    www.ConfluentMinds.com

    Example/* Submit a repeating request */

    result := FND_REQUEST.SET_REPEAT_OPTIONS (, 4, HOURS,END);

    req_id := FND_REQUEST.SUBMIT_REQUEST (CUS,

    CUSPOST, Custom Posting,

    01APR01 00:00:00, FALSE,

    ...arguments...);

  • 7/28/2019 EBS3-Custom Applications Integration

    45/78

    www.ConfluentMinds.com

    FND_REQUEST.SET_PRINT_OPTIONS

    Optionally call before submitting a concurrent request to set print

    options. Returns TRUE on successful completion, and FALSEotherwise.

    FND_REQUEST.SET_PRINT_OPTIONS (Client or Server)

    function FND_REQUEST.SET_PRINT_OPTIONS

    (printer IN varchar2 default NULL,

    style IN varchar2 default NULL,copies IN number default NULL,

    save_output IN boolean default TRUE,

    print_together IN varchar2 default N)

    return boolean;

  • 7/28/2019 EBS3-Custom Applications Integration

    46/78

    www.ConfluentMinds.com

    Arguments Printer: Name of the printer to which concurrent request: output should be

    sent. You cannot override this print option if it was already set using theConcurrent Programs form.

    Style: Style used to print request output, for example Landscape or

    Portrait. (Valid print styles are defined using the Print Styles form.) If the

    Style option was already set using the Concurrent Programs form, and theStyle Required check box is checked, you cannot override this print option.

    Copies: Number of copies of request output to print. You can override thisprint option even if it was already set using the Concurrent Programs form.

    save_output: Indicates whether to save the output file. Valid values areTRUE and FALSE. You can override this print option even if it was alreadyset using the Concurrent Programs form.

    print_together : This parameter applies only to requests that contain subrequests. Y indicates that output of subrequests should not be printeduntil all subrequests complete. N indicates that the output of each subrequest should be printed as it completes.

  • 7/28/2019 EBS3-Custom Applications Integration

    47/78

    www.ConfluentMinds.com

    FND_REQUEST_INFO.GET_PARAMETER

    This function returns the concurrent requests parameter value for a

    given parameter number. The function will return the value asvarchar2.

    Syntax:

    function GET_PARAMETER

    (param_num IN NUMBER)

    return varchar2; Arguments:

    param_num : The number of the parameter of the requests concurrent

    program.

  • 7/28/2019 EBS3-Custom Applications Integration

    48/78

    www.ConfluentMinds.com

    FND_REQUEST_INFO.GET_PROGRAM

    This procedure returns the developer concurrent program name and

    application short name.

    Syntax:

    PROCEDURE GET_PROGRAM

    (program_name OUT VARCHAR2,

    program_app_name OUT VARCHAR2);

    Arguments:

    program_name : The name of the concurrent program.

    program_app_name :The concurrent programs application short name.

  • 7/28/2019 EBS3-Custom Applications Integration

    49/78

    www.ConfluentMinds.com

    Message Dictionary

  • 7/28/2019 EBS3-Custom Applications Integration

    50/78

    www.ConfluentMinds.com

    Message Dictionary Message Dictionary lets you catalog messages for display from your

    application without hard coding them into your forms and programs.

    You can define standard messages and use in all your applicationsto provide a consistent look and feel for messages

    Define flexible messages that include contextsensitive variable text

    Change or translate the text of your messages without regeneratingor recompiling your application code.

    Navigate to ApplicationDeveloper->Application -> Messages to add/edit amessage.

    Enter name of the

    message, language andApplication where itbelongs.

    Enter the message incurrent message text.

    f

  • 7/28/2019 EBS3-Custom Applications Integration

    51/78

    www.ConfluentMinds.com

    Define Messages Number - Enter any appropriate

    number for your message. If youdefine a non-zero messagenumber for your message,Message Dictionary automaticallyprepends your message with theprefix APP:

    Type- Use the message type to

    classify your messages. It is used to help translators

    translate messages within lengthexpansion constraints that vary bymessage type.

    The message length limits (in

    bytes) are 60 for Menu Entry, 250for Hint, and 80 for Title (note thatthese limits are for translatedmessages, so messages in Englishshould be 30% shorter if they willbe translated).

    Maximum Length - It is used to helptranslators translate messages withinlength expansion constraints imposed bythe form or program that uses themessage. If your message is in English,the maximum length you specify shouldbe at least 30% longer than your actualEnglish message to allow for expansionduring translation.

    D fi M

  • 7/28/2019 EBS3-Custom Applications Integration

    52/78

    www.ConfluentMinds.com

    Define Messages Description - You should enter information in this field that would help

    explain the context of this message to translators.

    This field is required if the message is of type Token or Other.

    After defining your messageyou need to run GenerateMessages program to build

    your message file. Your new messages take effect

    as soon as your concurrentrequest finishes successfullyand you have placed the new

    file in the appropriatedirectories.

    M Di ti B ilt i

  • 7/28/2019 EBS3-Custom Applications Integration

    53/78

    www.ConfluentMinds.com

    Message Dictionary Built-ins FND_MESSAGE.CLEAR Clears the message stack of all the messages.

    FND_MESSAGE.DEBUG Immediately displays the string passed to it as inputparameter.

    FND_MESSAGE.ERASE Clears the oracle Forms status line.

    FND_MESSAGE.ERROR - Displays an error message in an Oracle Forms modalwindow or a concurrent program log file. (Example: Invalid value entered.).

    It takes its message from the stack, displays the message, and then clears all the

    messages from the message stack. FND_MESSAGE.GET - Retrieves a translated and tokensubstituted message

    from the message stack and then clears that message from the message stack.This could be used for getting a translated message for a forms builtin or otherfunction. Assumes you have already called FND_MESSAGE.SET_NAME and, ifnecessary, FND_MESSAGE.SET_TOKEN. It returns up to 2000 bytes ofmessage.

    FND_MESSAGE.HINT - Displays a message in the Oracle Forms status line. Ittakes its message from the stack, displays the message, and then clears thatmessage from the message stack. The user may still need to acknowledge themessage if another message immediately comes onto the message line.

    M Di ti B ilt i

  • 7/28/2019 EBS3-Custom Applications Integration

    54/78

    www.ConfluentMinds.com

    Message Dictionary Built-ins FND_MESSAGE.QUESTION - Displays a message and up to three buttons in an

    Oracle Forms modal window. (Example: Please choose one of the following

    actions: ) It takes its message from the stack, and clears that message. After theuser selects a button, It returns the number of the button selected.

    For each button, you must define or use an existing message in MessageDictionary (under the Oracle Application Object Library application) that containsthe text of the button. This routine looks for your button name message in theOracle Application Object Library messages, so when you define your message,

    you must associate it with Oracle Application Object Library (the FNDapplication) instead of your application.

    FND_MESSAGE.RETRIEVE - Retrieves a message from the database server,translates and substitutes tokens, and sets the message on the message stack.

    FND_MESSAGE.SET_NAME - Retrieves your message from Message Dictionaryand sets it on the message stack. You call it once for each message you use in

    your clientside PL/SQL procedure. You must call this procedure before you callFND_MESSAGE.SET_TOKEN.

    FND_MESSAGE.SET_STRING - Takes an input string and sets it directly on themessage stack. The string does not need to be defined in the Messages window.These strings may be hard coded into the form and are not translated likemessages defined in Message Dictionary.

    M Di ti B ilt i

  • 7/28/2019 EBS3-Custom Applications Integration

    55/78

    www.ConfluentMinds.com

    Message Dictionary Built-ins FND_MESSAGE.SET_TOKEN - Substitutes a message token with a value you

    specify. You call FND_MESSAGE.SET_TOKEN once for each token/value pair in

    a message. The optional translate parameter can be set to TRUE to indicate thatthe value should be translated before substitution. (The value should be translatedif it is, itself, a Message Dictionary message name.)

    FND_MESSAGE.SHOW - Displays an informational message in an Oracle Formsmodal window or a concurrent program log file. (Example: To complete thisfunction, please enter the following... ). It takes its message from the stack,

    displays the message, and then clears only that message from the messagestack.

    FND_MESSAGE.WARN - Displays a warning message in an Oracle Forms modalwindow and allows the user to either accept or cancel the current operation.(Example: Do you wish to proceed with the current operation?)FND_MESSAGE.WARN returns TRUE if the user accepts the message (that is,

    clicks OK), or FALSE if the user cancels. It takes its message from the stack,displays the message, and clears that message from the message stack.

    Most frequently used procedures are FND_MESSAGE.SET_NAME andFND_MESSAGE.SET_TOKEN

    M Di ti B ilt i

  • 7/28/2019 EBS3-Custom Applications Integration

    56/78

    www.ConfluentMinds.com

    Message Dictionary Built-ins Example : FND_MESSAGE.SET_NAME is used to retrieve the

    message and put it on the message stack. Message name is WANTTO CONTINUE.

    FND_MESSAGE.SET_TOKEN is used to replace the tokenPROCEDURE with text Compiling this flexfield.

    Sample Code:

    FND_MESSAGE.SET_NAME (FND, WANT TO CONTINUE);FND_MESSAGE.SET_TOKEN (PROCEDURE, Compiling this flexfield);

    IF FND_MESSAGE.WARN THEN

    /* User want to continue */

    ELSE

    /* User want to cancel*/

    END;

  • 7/28/2019 EBS3-Custom Applications Integration

    57/78

    www.ConfluentMinds.com

    Forms Personalization

    O i

  • 7/28/2019 EBS3-Custom Applications Integration

    58/78

    www.ConfluentMinds.com

    Overview Allows you to make declarative changes to a form.

    Changes get applied at runtime when the proper trigger eventoccurs.

    Changes can get applied based on who you are and otherconditions

    You can:

    Change object properties

    Execute certain Forms builtins

    Display messages

    Activate menu entries

    I ki P li ti

  • 7/28/2019 EBS3-Custom Applications Integration

    59/78

    www.ConfluentMinds.com

    Invoking Personalization screen Open the form that you want to modify ..

    I ki P li ti

  • 7/28/2019 EBS3-Custom Applications Integration

    60/78

    www.ConfluentMinds.com

    Invoking Personalization screen Select Help > Diagnostics > CustomCode> Personalize from the pulldown menu

    Profiles Utilities: Diagnostics and Hide Diagnostics menu entry control access to this entry

    The personalization screen will now run It will automatically query any rules if they exist for that function as ..

    R l d C diti

  • 7/28/2019 EBS3-Custom Applications Integration

    61/78

    www.ConfluentMinds.com

    Rules and Conditions

    Rules govern when personalization get evaluated:

    Function Name: the name of the function that you ran. Personalization are made for afunction, not a form.

    Seq: an ordering from 1 (first) to 100 (last)

    Description: allows you to record why you are making the change

    Enabled: used to temporarily disable a rule

    Trigger Event: the event within the form that causes invocation of the rule

    Trigger object: the context for the trigger event, such as a particular block or item

    Condition: an optional SQL fragment that, when it evaluates to TRUE, allows the ruleto execute. An Advanced class describes Conditions.

    Actions

  • 7/28/2019 EBS3-Custom Applications Integration

    62/78

    www.ConfluentMinds.com

    Actions

    Actions determine what the personalization does:

    Seq: an ordering from 1 (first) to 100(last)

    Type: Property, Message, Builtin, or Special Depending on the Type, the panel will change to show additional fields

    Description: allows you to record why you are making the change

    Language: a list of installed languages, and ALL. An action associated with a specific language will only be executed in the context of that language

    Enabled: used to temporarily disable an action

    Actions: Property

  • 7/28/2019 EBS3-Custom Applications Integration

    63/78

    www.ConfluentMinds.com

    Actions: Property

    Used to set a property of an item

    Select By Text: choose an object by its onscreen text

    Object Type and Target Object: internal identifier of the object

    Property Name: the property to change

    Value: the new value

    Get Value: extract the current property value into the Value field

    Actions: Property Example

  • 7/28/2019 EBS3-Custom Applications Integration

    64/78

    www.ConfluentMinds.com

    Actions: Property Example

    This action:

    Changes this screen: To this:

    Actions: Message

  • 7/28/2019 EBS3-Custom Applications Integration

    65/78

    www.ConfluentMinds.com

    Actions: Message

    Used to display a popup message

    Message Type: Error, Warning, Hint, Question, Debug

    Message Text: the text of the message

    Actions: Message Example

  • 7/28/2019 EBS3-Custom Applications Integration

    66/78

    www.ConfluentMinds.com

    Actions: Message Example

    Causes this dialog

    to appear:

    This action:

    Actions: Builtin

  • 7/28/2019 EBS3-Custom Applications Integration

    67/78

    www.ConfluentMinds.com

    Actions: Builtin

    Used to perform processing by calling Forms and AOL functions

    Builtin Type:

    GO_ITEM and GO_BLOCK

    DO_KEY RAISE FORM_TRIGGER_FAILURE,

    FORMS_DDL

    FND_UTILITIES.OPEN_URL

    Launch a Function

    Launch SRS Form

    Arguments Vary based on the Type

    Actions: Builtin Example

  • 7/28/2019 EBS3-Custom Applications Integration

    68/78

    www.ConfluentMinds.com

    Actions: Builtin Example For opening Lookups: Common form, set the built-in type as Launch

    a function and choose the function code for Lookups form from the

    LOV. Save the changes.

    Reopen the form and ensure the triggering conditions are met, Nowyou can see the Lookups form opening from there.

    Actions: Special

  • 7/28/2019 EBS3-Custom Applications Integration

    69/78

    www.ConfluentMinds.com

    Actions: Special

    Used to activate up to 45 pre-seeded menu entries

    Menu Entry: SPECIAL1 through SPECIAL45

    Menu Label: the text for the menu entry

    Render Line before menu: will draw a line above the menu entry

    Enabled In Block(s): the blocks for which the menu entry should be enabled.

    Leave blank for all blocks.

    Icon Name: the name of a .ico file

    Actions: Special Example

  • 7/28/2019 EBS3-Custom Applications Integration

    70/78

    www.ConfluentMinds.com

    Actions: Special Example

    This action:

    Activates the Toolsmenu and creates

    the menu entry, forall blocks of theform:

    Actions: Speciald

  • 7/28/2019 EBS3-Custom Applications Integration

    71/78

    www.ConfluentMinds.com

    contd.. Based on the special menu entry name, the corresponding special trigger will be

    fired.You need to set up for the above trigger as ..

    If you want to open Lookups: Common form for this menu action, set the built-intype as Launch a function and choose the function code for Lookups form from theLOV. Save the changes.

    Working with Strings

  • 7/28/2019 EBS3-Custom Applications Integration

    72/78

    www.ConfluentMinds.com

    Working with Strings Every property that takes a string can work one of two ways

    If the string you type does not start with =, then it be used exactly as you typed it

    If the string you type starts with =, then it will be evaluated at runtime. You can referto:

    bind variables, like :block.field

    SQL operators, such as ||, TO_CHAR(), DECODE() and NVL()

    Server-side functions that do not have OUT parameters

    Working with Strings Example

  • 7/28/2019 EBS3-Custom Applications Integration

    73/78

    www.ConfluentMinds.com

    Working with Strings Example

    This action:

    Causes this dialogto appear

    (when run on 25-AUG-04):

    Context

  • 7/28/2019 EBS3-Custom Applications Integration

    74/78

    www.ConfluentMinds.com

    Context

    Context controls who personalization apply to:

    Level: Site, Responsibility, Industry, or User

    Value: The specific value when level is Responsibility, Industry, or User At runtime, if the users context matches any context of a rule, that rule is executed.

    Getting it right

  • 7/28/2019 EBS3-Custom Applications Integration

    75/78

    www.ConfluentMinds.com

    Getting it right Various features and functions are available to assist you:

    Trigger and Target Objects are validated

    Add buttons: allow you to select objects within the form using lists Apply Now: applies the current action immediately so you can see its effect

    Validate: for fields that support string evaluation, processes it immediately:

    Condition will return True, False, or an Error

    Value will return the resulting string, or an Error

    Add messages of Type Debug

    They will only display when Show Debug Messages is checked

    Limitations

  • 7/28/2019 EBS3-Custom Applications Integration

    76/78

    www.ConfluentMinds.com

    Limitations Although it is faster than a speeding bullet, it is not able to leap over tall buildings:

    You can only change what Forms allows at runtime: Cannot create new items

    Cannot move items between canvases

    Cannot display an item which is not on a canvas

    Cannot set certain properties

    Cannot change frames, graphics, boilerplate

    You can only respond to certain Trigger Events: WHEN-NEW-FORM-INSTANCE, WHEN-NEW-BLOCKINSTANCE, WHEN-NEW-RECORD-INSTANCE, WHENNEW-ITEM-INSTANCE

    WHEN-VALIDATE-RECORD (not in all forms)

    Product-specific events

    May interfere with, or be overridden by, base product code

    Expected user is an Admin/Developer Knowledge of PL/SQL, Coding Standards and/or APIs required in some cases

    Knowledge of Oracle Developer is extremely desirable

    Normal rules for customizations apply Extensive testing in a Test environment is required!

    Relationship to CUSTOM library

  • 7/28/2019 EBS3-Custom Applications Integration

    77/78

    www.ConfluentMinds.com

    Relationship to CUSTOM library CUSTOM is a stub library Oracle ships that receives Trigger Events. Customers are

    free to add any code they like to it.

    CUSTOM and Form Personalization drive off the same Trigger Events Form Personalization are processed first, then the event is sent to CUSTOM

    CUSTOM can do more because it has complete access to all PL/SQL and SQL

    But for most changes, Form Personalization is adequate and is significantly simpler.

    References

  • 7/28/2019 EBS3-Custom Applications Integration

    78/78

    References1. Oracle Applications Documentation library - Oracle Applications

    Developer's Guide, http://download-uk.oracle.com/docs/cd/B25516_08/current/html/docset.html