We will need to define three Rules for each of the forms used to achieve this. Each Rules will have their own set of Conditions and Actions.
The Rules definition logic will be as follows:
For the PO form
Create Menu Item
Check for NULL value
Open the Supplier form
For the Supplier form
Set initial value of Global Variable
Go to Block VNDR and enter Query mode
Execute query and set value of Global Variable back to NULL
How to create a Zoom from PO form to Supplier form
Navigate to the Purchase Orders window using the Purchasing SuperUser responsibility.
Enter the Form Personalization form. (M) Help > Diagnostics > Custom Code > Personalize.
Rule Seq: 10
Description: Create Menu Item
Trigger Event: WHEN-NEW-FORM-INSTANCE
Context: User and set the value to your user name (don't forget to do this for every Rule you define)
Select the Actions tab
Actions Seq: 10
Type: Menu
Menu Entry: SPECIAL31
Menu Label: Zoom to Supplier Form
----------------------------------------------
Rule Seq: 20
Description: Check for Null
Trigger Event: SPECIAL31
Condition: :PO_HEADERS.VENDOR_NAME IS NULL
Context: User and set the value to your user name
Actions Seq: 10
Type: Message
Message Type: Error
Message Text: Supplier Name cannot be Null. Please enter or query a value.
----------------------------------------------
Rule Seq: 30
Description: Open the Supplier Form
Trigger Event: SPECIAL31
Context: User and set the value to your user name
Actions Seq: 10
Type: Property
Object Type: Global Variable
Target Object: XX_VENDOR (or name it wathever you want)
Property Name: VALUE
Value: =:PO_HEADERS.VENDOR_ID (using Object's identifier ID's as the Global Variable's value makes for a more robust custom)
Actions Seq: 20
Type: Builtin
Builtin Type: Launch a Function
Function Code: AP_APXVDMVD
Function Name: Suppliers
Save your work and exit all the forms.
At this point, you should test what you have done so far. From the Navigator, reopen the Purchase Orders form. From the menu bar, select Actions > Zoom to Supplier form (the menu item you defined earlier). Because you do not yet have a Supplier entered on your new PO and you're trying to Zoom to the Supplier form, you should see the error message that you defined in the Rule Seq 20. If this works, then continue with following:
Navigate to the Suppliers window using the Purchasing SuperUser responsibility.
Enter the Form Personalization form. (M) Help > Diagnostics > Custom Code > Personalize.
Rule Seq: 10
Description: Set initial value of Global Variable
Trigger Event: WHEN-NEW-FORM-INSTANCE
Context: User and set the value to your user name
Select the Actions tab
Actions Seq: 10
Type: Property
Object Type: Global Variable
Target Object: XX_VENDOR (The Global Variable you defined earlier)
Property Name: INITIAL VALUE
Value: =NULL
----------------------------------------------
Rule Seq: 20
Description: Go to Block VNDR and enter Query mode
Trigger Event: WHEN-NEW-FORM-INSTANCE
Condition: :GLOBAL.XX_VENDOR IS NOT NULL
Context: User and set the value to your user name
Actions Seq: 10
Type: Builtin
Builtin Type: GO_BLOCK
Argument: VNDR
Actions Seq: 20
Type: Builtin
Builtin Type: DO_KEY
Argument: ENTER_QUERY
----------------------------------------------
Rule Seq: 30
Description: Execute query, go to Block SITE and reset Global Variable value to NULL
Trigger Event: WHEN-NEW-RECORD-INSTANCE
Trigger Object: VNDR
Condition: :GLOBAL.XX_VENDOR IS NOT NULL
Processing Mode: Both
Context: User and set the value to your user name
Actions Seq: 10
Type: Property
Object Type: Item
Target Object: VNDR.VENDOR_ID
Property Name: VALUE
Value: =:GLOBAL.XX_VENDOR
Actions Seq: 20
Type: Builtin
Builtin Type: DO_KEY
Argument: EXECUTE_QUERY
Actions Seq: 30
Type: Property
Object Type: Global Variable
Target Object: XX_VENDOR
Property Name: VALUE
Value: =NULL
Now go ahead and test your custom. Open the Purchase Orders form and start defining a new standard PO, enter a supplier in the Supplier field (in my example, I used "ABC Corp"). Click on (M) Actions > Zoom to Supplier Form
Bingo!, you are automatically taken to the Supplier form for "ABC Corp".
Once again, this is another example of how flexible Oracle Form Personalization is and don't forget how much time I have saved. It took me about 20 minutes to do this, including defining and testing. In the past, I would have had to send functional specs over to the Technical analyst and it would have taken a couple of days to have this done thru the Custom Library.
Try it, it's easy.
The Rules definition logic will be as follows:
For the PO form
For the Supplier form
How to create a Zoom from PO form to Supplier form
----------------------------------------------
----------------------------------------------
At this point, you should test what you have done so far. From the Navigator, reopen the Purchase Orders form. From the menu bar, select Actions > Zoom to Supplier form (the menu item you defined earlier). Because you do not yet have a Supplier entered on your new PO and you're trying to Zoom to the Supplier form, you should see the error message that you defined in the Rule Seq 20. If this works, then continue with following:
----------------------------------------------
----------------------------------------------
Now go ahead and test your custom. Open the Purchase Orders form and start defining a new standard PO, enter a supplier in the Supplier field (in my example, I used "ABC Corp"). Click on (M) Actions > Zoom to Supplier Form
Bingo!, you are automatically taken to the Supplier form for "ABC Corp".
Once again, this is another example of how flexible Oracle Form Personalization is and don't forget how much time I have saved. It took me about 20 minutes to do this, including defining and testing. In the past, I would have had to send functional specs over to the Technical analyst and it would have taken a couple of days to have this done thru the Custom Library.
Try it, it's easy.
No comments:
Post a Comment