Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

Senthilkumar Shanmugam
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

×

Warning

JUser: :_load: Unable to load user with ID: 881

In Oracle MSCA, it is very common requirement with almost every client for some form of custom validation to be built in. This includes number of things like

  • Setting a default value.
  • Inserting some data into a custom table.
  • Enable/disable a field, Making them read only.
  • Displaying a warning/error message in MSCA.
  • Navigate to confirmation page before proceeding with the transaction.
  • Validations against DFF.
  • Checking for length of a value entered for a field etc…

Though WMS Personalization Framework addressed few of the above requirements, it has its own restrictions. So Oracle came up with programmatic way to address these requirements. Customer can define their own validation logic for any editable field on any mobile application page using a special class called CustomListener.java.

This will be extremely beneficial to all customers who are looking to perform some custom validations and this can be done without customizing the MSCA page java code.

What is CustomListener.java?

CustomListener.java is a hook provided by Oracle to write customer specific validations for MSCA pages. Any editable field in MSCA can be captured in this hook and validated. Custom hooks are not new in Oracle world. We have custom hooks in HCM, PO, INV modules and they are mostly PLSQL. We also have a custom hook called CustomScanManager.java in MSCA which is used for barcode scanning validations.

In technical terms it is almost similar to custom.pll which we have in Oracle Forms.

How to implement it?

Pre-Req:

  • The profile option 'MWA: Enable Personalization'  must be set to Yes.
  • Patch 12835870:R12.MWA.B has to be applied.
  • I assume that the reader of the article have basic knowledge of MSCA development. Please go through my previous  articles here.

Here is a simple example

package oracle.apps.mwa.beans;

import oracle.apps.inv.rcv.server.RcptGenPage;

import oracle.apps.inv.utilities.server.UtilFns;

import oracle.apps.mwa.eventmodel.AbortHandlerException;

import oracle.apps.mwa.eventmodel.DefaultOnlyHandlerException;

import oracle.apps.mwa.eventmodel.InterruptedHandlerException;

import oracle.apps.mwa.eventmodel.MWAEvent;

import oracle.apps.mwa.eventmodel.MWAFieldListener;

public class CustomListener implements MWAFieldListener {

    /* This method will be called for field entered in MSCA pages */

    public void fieldEntered(MWAEvent e) throws AbortHandlerException,

                                                InterruptedHandlerException,

                                                DefaultOnlyHandlerException {

        UtilFns.trace("oracle.apps.mwa.beans.CustomListener. - FieldEntered");

        /* Check for the page name */

        if (("oracle.apps.inv.rcv.server.RcptGenPage").equals(e.getSession().getCurrentPageName())) {

       

            UtilFns.trace("oracle.apps.mwa.beans.CustomListener. - RMA Page Entered!");

            /* Default the value for Sub Inventory */

            RcptGenPage curtPage =

                (RcptGenPage)e.getSession().getCurrentPage();

            curtPage.getSubFld().setValue("RETURNS");

            UtilFns.trace("oracle.apps.mwa.beans.CustomListener. - Defaulting of sub Inventory done!");

        }

    }

    /* This method will be called for field exit in MSCA pages */

    public void fieldExited(MWAEvent e) throws AbortHandlerException,

                                               InterruptedHandlerException,

                                               DefaultOnlyHandlerException {

        UtilFns.trace("oracle.apps.mwa.beans.CustomListener. - FieldExited");

        /* Check for the page name and field name (RMA Number) */

        if (("oracle.apps.inv.rcv.server.RcptGenPage").equals(e.getSession().getCurrentPageName()) &&

            ("INV.DOC_NUMBER").equals(e.getSession().getCurrentPage().getCurrentFieldBean().getName())) {

           

           

            UtilFns.trace("oracle.apps.mwa.beans.CustomListener. - RMA Page, RMA Field Exited!");

            RcptGenPage curtPage =

                (RcptGenPage)e.getSession().getCurrentPage();

            // Get the RMA Number and print it in Log file

            String rmaNum = (String)curtPage.getDocFld().getValue();

            UtilFns.trace("oracle.apps.mwa.beans.CustomListener." + rmaNum);

        }

    }

}

Explanation:

Here is what we did:

As any MWA Listener, this class file have fieldEntered() and fieldExited() methods.

I did two things here:

  • Set  a default value for Sub Inventory for "RMA Receipt" page as "RETURNS"
  • Get the RMA Number selected in the MSCA for the transaction and print in log files

Since the defaulting of  Sub Inventory needs to happen before the page loads, it goes into fieldEntered() method.

The RMA Number can be captured only when the user selects the value for the RMA field and hence it goes into fieldExited() method.

Sounds simple right!!

Deployment:

Copy the file CustomListener.java to $JAVA_TOP/oracle/apps/mwa/beans/

Compile the file and make sure the class file CustomListener.class is generated.

Bounce the MSCA services.

Debugging:

Debugging is nothing different for this hook. It is the same as we do for normal MSCA development. More details on my previous article.

STEPS 

 Select RMA Transaction

 

 

Log file entry which shows that fieldEntered() is already fired

MSCA2

 

Select any RMA

MSCA3

 

Log file entry shows that fieldExit() for RMA number is fired and it is printing the selected RMA Number

MSCA4

 

Sub Inventory field is defaulted to "RETURNS" as we select ITEM, the field gets visible and we are able to see the default value

Hope you enjoyed reading the article.

For MSCA/OAF consulting kindly contact us at This email address is being protected from spambots. You need JavaScript enabled to view it.

 


Comments   

0 #1 Ashutosh Mishra 2015-05-06 20:57
Hi Senthil,

We had a requirement where we were asked to make
some customization to a standard oracle mobile page
to do a validation on the length of value that is being
scanned in a particular field.

What I have already done is, I have created the
CustomScanManag er class to perform validation on
the scanned field. NOW when we perform testing of this
using Mobile GUI for windows on local
machine by pressing cntrl+\ and entering the value then
the CustomScanManag er class gets invoked and the
validation logic is run and we are getting the desired
redults. But when we try to test this on mobile device
using a Motorola Scanner then the validation is not at all Getting called through CustomScanManag er.

I did various rounds of testing and debugging only to find that if on device we press cntrl+\ and then we scan the bar code, then the validation is working. Else on directly scanning the value, validation is not working.

Now as per my understanding, the scanner is not setup to prefix cntrl+\ before the scanned value so the CustomScanManag er manager is not at all getting invoked here (correct me if I Am wrong on this). I am not sure whether we would be able to get this configuration changes done to the scanner devive.

How ever if this is the case where scanner is getting onlu plain characters without prefixing any thing, then I was wondering whther I can implement CustomListener Logic preaented in this article to get hold of my requirements. .

I am waiting fot your valuable inputs on this.

TIA..
Quote
+1 #2 Senthil 2015-05-07 09:00
Hi Asuthosh,

Ask your system administrator of the Handheld Gun to prefix DataStreamIndic ator (by default it will be ASCII 28) for the barcode scan.

This will invoke your CustomScanManager.

Hope this helps.

Thanks and Regards,
Senthil


Quoting Ashutosh Mishra:
Hi Senthil,

We had a requirement where we were asked to make
some customization to a standard oracle mobile page
to do a validation on the length of value that is being
scanned in a particular field.

What I have already done is, I have created the
CustomScanManager class to perform validation on
the scanned field. NOW when we perform testing of this
using Mobile GUI for windows on local
machine by pressing cntrl+\ and entering the value then
the CustomScanManager class gets invoked and the
validation logic is run and we are getting the desired
redults. But when we try to test this on mobile device
using a Motorola Scanner then the validation is not at all Getting called through CustomScanManager.

I did various rounds of testing and debugging only to find that if on device we press cntrl+\ and then we scan the bar code, then the validation is working. Else on directly scanning the value, validation is not working.

Now as per my understanding, the scanner is not setup to prefix cntrl+\ before the scanned value so the CustomScanManager manager is not at all getting invoked here (correct me if I Am wrong on this). I am not sure whether we would be able to get this configuration changes done to the scanner devive.

How ever if this is the case where scanner is getting onlu plain characters without prefixing any thing, then I was wondering whther I can implement CustomListener Logic preaented in this article to get hold of my requirements. .

I am waiting fot your valuable inputs on this.

TIA..
Quote
0 #3 Senthil 2015-05-07 09:02
If you are not able to make CustomScanManag er working, you can very well use CustomListener.


Quoting Senthil:
Hi Asuthosh,

Ask your system administrator of the Handheld Gun to prefix DataStreamIndicator (by default it will be ASCII 28) for the barcode scan.

This will invoke your CustomScanManag er.

Hope this helps.

Thanks and Regards,
Senthil


Quoting Ashutosh Mishra:
Hi Senthil,

We had a requirement where we were asked to make
some customization to a standard oracle mobile page
to do a validation on the length of value that is being
scanned in a particular field.

What I have already done is, I have created the
CustomScanManag er class to perform validation on
the scanned field. NOW when we perform testing of this
using Mobile GUI for windows on local
machine by pressing cntrl+\ and entering the value then
the CustomScanManag er class gets invoked and the
validation logic is run and we are getting the desired
redults. But when we try to test this on mobile device
using a Motorola Scanner then the validation is not at all Getting called through CustomScanManag er.

I did various rounds of testing and debugging only to find that if on device we press cntrl+\ and then we scan the bar code, then the validation is working. Else on directly scanning the value, validation is not working.

Now as per my understanding, the scanner is not setup to prefix cntrl+\ before the scanned value so the CustomScanManag er manager is not at all getting invoked here (correct me if I Am wrong on this). I am not sure whether we would be able to get this configuration changes done to the scanner devive.

How ever if this is the case where scanner is getting onlu plain characters without prefixing any thing, then I was wondering whther I can implement CustomListener Logic preaented in this article to get hold of my requirements. .

I am waiting fot your valuable inputs on this.

TIA..
Quote
0 #4 Ashutosh Mishra 2015-05-14 20:33
Hi Senthil,

Thanks for the quick reply on this. Prefixing worked for me.

Your articles on MSCA are really a boon for all of us who are new to this. Thanks for all your efforts.

Quoting Senthil:
If you are not able to make CustomScanManager working, you can very well use CustomListener.


Quoting Senthil:
Hi Asuthosh,

Ask your system administrator of the Handheld Gun to prefix DataStreamIndicator (by default it will be ASCII 28) for the barcode scan.

This will invoke your CustomScanManager.

Hope this helps.

Thanks and Regards,
Senthil


Quoting Ashutosh Mishra:
Hi Senthil,

We had a requirement where we were asked to make
some customization to a standard oracle mobile page
to do a validation on the length of value that is being
scanned in a particular field.

What I have already done is, I have created the
CustomScanManager class to perform validation on
the scanned field. NOW when we perform testing of this
using Mobile GUI for windows on local
machine by pressing cntrl+\ and entering the value then
the CustomScanManager class gets invoked and the
validation logic is run and we are getting the desired
redults. But when we try to test this on mobile device
using a Motorola Scanner then the validation is not at all Getting called through CustomScanManager.

I did various rounds of testing and debugging only to find that if on device we press cntrl+\ and then we scan the bar code, then the validation is working. Else on directly scanning the value, validation is not working.

Now as per my understanding, the scanner is not setup to prefix cntrl+\ before the scanned value so the CustomScanManager manager is not at all getting invoked here (correct me if I Am wrong on this). I am not sure whether we would be able to get this configuration changes done to the scanner devive.

How ever if this is the case where scanner is getting onlu plain characters without prefixing any thing, then I was wondering whther I can implement CustomListener Logic preaented in this article to get hold of my requirements. .

I am waiting fot your valuable inputs on this.

TIA..
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Apr 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
  1  2  3  4  5  6  7
  8  91011121314
15161718192021
22232425262728
2930     

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner