Thursday, July 17, 2014

How to invoke an Oracle apps form from a workflow notification

How to invoke an Oracle apps form from a workflow notification

Open Document functionality is a standard functionality within Oracle workflow. This functionality allows the user to go a particular transaction directly from the notification. The user gets to see a link in the workflow notification. On clicking this link he/she is directly taken to the Oracle form. The form opens and automatically queries the data for the user to view.


This functionality exists in seeded workflows. We can use this functionality within custom workflows to allow the users view the data directly in Apps from the notification.

We would like to show a particular GL journal to the user from our custom workflow. The journal is shown below.

Journal


We will check the Journal Header ID as this is the primary key that will be used to uniquely identify the data and will be used in querying the form once it opens from the notification.
Click on Help > Diagnostics > Examine
We get Header ID = 979869.
Step 1: Oracle Form check
Now we need to check the form name and the function name. Click on Help > Diagnostics > Custom Code > Personalize.
Note the Form and Function name. The Function name is GLXJEENT_A and the form name is GLXJEENT.
We have to check the parameters for the form so that we can pass the right values into it. To do so, we need to download the form down into our local computer so that we can open the form in Forms Builder to identify the parameters. We shall download the form,GLXJEENT.fmb, from $AU_TOP/forms/US directory on the server. After downloading and opening the form we shall open the Parametersection. It will look like the following,
We need to pass values into some of the form parameters displayed above. For this form we have to pass values into 3 parameters,
  • AUTOQUERY_LEVEL
  • AUTOQUERY_COORDINATION
  • AUTOQUERY_CRITERIA
Check the properties of each of the parameters
  • AUTOQUERY_LEVEL
  • AUTOQUERY_COORDINATION
  • AUTOQUERY_CRITERIA
From the properties of the parameters we will get to know what kind of values to pass.
Step 2: Develop the workflow
Develop a workflow in the Workflow Builder. This will be a very simple workflow that will send an approval message to an approver who will get the Form link in the notification. We have created our workflow type, Test Form from Workflow, and the Internal name isTESTFORM.
Main features of the workflow are,
  1. Attribute for storing the Journal Header id
  2. Attribute to store the Form link
  3. Attribute to store the approver number
  4. Approval message
  5. Approval notification
  6. Approval process
The workflow is shown below.
Check the attribute, View Journal form.
Note that the type of this attribute is Form. Also note the value. It is set to GLXJEENT_A:AUTOQUERY_LEVEL=”JOURNAL” AUTOQUERY_COORDINATION=”INITIAL” autoquery_criteria=”&JE_HEADER_ID”.
Important:
Format for invoking a form is,
<Function Name>:<Param1>=”&WF_ATTRIBUTE1″ <Param2>=”&WF_ATTRIBUTE 2″….
We need to pass the values of the form parameters into the form function as given above and workflow will identify the form from the function and invoke it from the notification.
Ensure that the View Journal Form attribute is attached to the workflow message along with the other attributes, Journal Header ID andApprover Number. The properties of the View Journal Form attribute on the message level is,
The message is set as
The workflow process is
After the development is done, save the workflow into the database.
Step 3: Test the workflow
Login to Oracle and go to Workflow Administrator responsibility. Then navigate to Developer Studio tab.
Enter the Workflow Type = Test Form from Workflow or the Internal Name as TESTFORM. Then click on Go button.
You will get to see the workflow now. Click on the Run icon. Now you will be taken to the workflow initiation screen. Enter the values forItem KeyJournal header ID and Approver Number fields as these values are essential to the workflow. The value for View Journal Form workflow attribute will be automatically populated from the workflow itself.
Point: We have passed the Journal Header ID for the journal that we had viewed at the beginning of this article so that we can verify the results.
Click on Submit button. You will get a confirmation message.
Click on OK. Then click on Status Monitor tab.
Enter the following on Status Monitor,
Type Internal Name: TESTFORM
Item Key: TEST10013
Click on Go
Click on Select and then Activity History. Now all the activities are shown and we see that workflow has sent the notification to the approver.
Click on the Notification icon.
Now the notification is displayed. You can now see the link, View Journal Form, on the bottom left of the screen.
Note:
The link name is always same as the attribute name.
Click on the link, View Journal Form.
Now the Oracle Apps form applet opens and we are prompted for a responsibility. Since we are about to view a Journal we need to select a General Ledger responsibility.
When we click on OK. The responsibility changes and the Journal form opens with the details of the Journal.
The link we created to the form is working perfectly. The same method can be used to invoke other seeded forms as well as custom forms.

1 comment: