Oracle Apps Notes

A collection of my random notes, primarily on Oracle Apps

Accessing Oracle Forms from Workflow(and a nifty Personalization)

It is quite an easy task to enable a user to open a Form directly from an Oracle Workflow Notifications page. In fact, we can also pass parameters to the form so that it automatically queries the form and displays a record based on the parameter which is passed. This post demonstrates how this is done. Along the way we will also look at a small but pretty useful trick – clicking a button through Form Personalization.

Following are the basic steps:

  1. Register a form function as per requirement
  2. Create an attribute of type ‘Form’ which stores the name of the form function and the parameter with which we want to call it.
  3. In a workflow process include a notification message.
  4. Associate the attribute with the notification message

The form that I want to call from Notifications window is the Find Service Request function. When calling the function, I will be passing a parameter which will be populated in the appropriate field and the search button will be clicked automatically.

Since the Find Service Request function does not accept any parameters, first I will register my own function(XXXSRTEST) based on the seeded form so that my function will be able to accept the parameter which I will pass to it from the Workflow.

As you can see from the following screen shots, the only difference between my function and the seeded Find Service Request function(CSXSRISV) is that my function can accept the CUSTOMER_ID parameter.

Add the function to the appropriate menu so that it is accessible from the responsibility from where the Workflow Notifications will be viewed. Now I will open the function and personalize it so that the parameter that I pass is populated in the appropriate field and the Search button is clicked automatically. I create the following personalization rule:
Seq:10
Description:Accept parameter and execute query
Condition
Trigger Event:WHEN-NEW-FORM-INSTANCE
Trigger Object:None
Condition:None
Processing Mode:Not In Enter-Query Mode
Context:
Level: Site

Then I add three actions to the rule. In the first action(seq#20), I populate the appropriate field in the form with the value stored in the parameter which I created for this function. During runtime, I will pass a value to this parameter from the Workflow.

In the second(seq#30) and third actions(seq#31) I click the Search button automatically through personalization. First I shift focus to the Search button using the ‘GO_ITEM’ builtin.

Then I call the EXECUTE_TRIGGER builtin with argument WHEN-BUTTON-PRESSED to simulate the button press.

Once these personalizations are done, I will make the function inaccessible from the front end by removing the prompt name for the function from the menu.
In the Workflow, I add two attributes – ‘PO Number’ and ‘Open a Form’. ‘PO Number’ is a text type attribute which is set to a value of 4880(this is the parameter which I will pass to my form) and it has the internal name ‘PO_NUM’

‘Open a Form’ is an attribute of type ‘Form’ and it is set to a value XXXSRTEST:CUSTOMER_ID=&PO_NUM. The value indicates that the form function to be opened is XXXSRTEST with the parameter CUSTOMER_ID. The value stored in the attribute PO_NUM will be passed to the parameter.

Create a message and associate both these attributes with the message. Attach the message to a notification.Associating a ‘Form’ type attribute with the notification message displays a link in the Notification at runtime which can be clicked to open the Form.

Run the Workflow and open the notifications page. You will see a link in the ‘References’ sections with the same name as that of the ‘Form’ type attribute.

Clicking on the link opens my custom function ‘XXXSRTEST’ while passing the value 4880(stored in the PO Number attribute) to parameter CUSTOMER_ID. The personalizations in the function populates the Service Request Number field with the value of the parameter and automatically clicks on the Search button to execute the query and the appropriate record is displayed.

Note:

  1. The form function will open automatically only if it is accessible from the same responsibility from which the Workflow Notification is viewed otherwise it will prompt you to choose the responsibility manually.
  2. The syntax for accessing a form with parameters may vary depending upon the EBS version, in my instance XXXSRTEST:CUSTOMER_ID=&PO_NUM works. If it doesn’t work in your system try using XXXSRTEST:CUSTOMER_ID=’&PO_NUM’ or XXXSRTEST:CUSTOMER_ID=”&PO_NUM”.

Advertisements

5 responses to “Accessing Oracle Forms from Workflow(and a nifty Personalization)

  1. svarmit May 14, 2012 at 5:54 pm

    Hi,
    I have done this whole process but finally when i go to workflow notification page .
    I see the notification however the references is empty.That means i am not getting the link of the form.
    Could you please help me in this

    Regards,
    Svarmit

    • oracleappsnotes May 15, 2012 at 10:14 am

      The link should appear when you add the attribute ‘Open A Form’ even if the syntax for referring to the form is incorrect. Make sure that you have added the attribute.

      • svarmit May 17, 2012 at 3:13 pm

        hi ,
        I have created the attribute properly. can you please send me some email id so that i can send the screen shots so that u can verify if i am doing it right way ..
        Is there any setup or front end changes required ?

        Regards,
        Svarmit

  2. svarmit May 17, 2012 at 3:12 pm

    hi ,
    I have created the attribute properly. can you please send me some email id so that i can send the screen shots so that u can verify if i am doing it right way ..
    Is there any setup or front end changes required ?

    Regards,
    Svarmit

  3. manu October 16, 2013 at 1:15 am

    Hi,
    Please help.

    When i click on the link in notification, I am getting the below errors:
    FRM-47023: No Such parameter named G_QUERY_FIND exists inform FAXMADDS
    FRM-40105: Unable to resolve reference to item PARAMETER:G_QUERY_FIND
    FRM-47023: No such parameter named CREATE_BATCH_ID exists in form FAXMADDS.

    This is a summary of what i did:
    Register a new custom form function with a parameter CREATE_BATCH_ID. Function name is XXFAXMADDS. Its just the seeded FAXMADDS form function, just with the addition of parameter.
    Create an attribute of type ‘Form’ which stores the name of the form function and the parameter with which we want to call it. The default value of the attribute is XXFAXMADDS:CREATE_BATCH_ID
    In a workflow process include a notification message.
    Associate the attribute with the notification message
    Personalize the new form function, to add actions to assign the value of parameter to the form field, then goto the Find Button, and click it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: