Custom Validation in VC

I have an issue with validating complex data entered in VC screens.
A customer needs to enter a reference that must (for example) be in the format "DExxxxxx" where x is a number.  Obviously we can validate the starting two letters and the length, but as far as we can see there is no way of checking whether what is entered in the last 6 spaces is numeric or alphabet and therefore the user could have entered DERAFJTY rather than the required 6 numbers.
Is there a way of validating this type of entry within VC?

Hi Emily,
You can convert the last 6 characters to a number and check the result using NVAL. In case NVAL gets a string representing 0 or a non-numeric value, it will return null (which can be checked with ISNULL).
You can use the following dynamic expression (for example, if your input field is stored in store@TXT1):
ISNULL(NVAL(RIGHT(store@TXT1,LEN(store@TXT1)-2)))&&(RIGHT(store@TXT1,LEN(store@TXT1)-2)!="000000")
The rest of the conditions (string length and the first 2 letters) can be checked as usual.
Best regards,
Tal.

Similar Messages

  • Perform custom validation on invoices created via iSupplier portal in R12

    Hello,
    It seems that since R12, invoices created on iSupplier portal are no longer loaded via Payables open interface tables (while ASBN's still are). It is nice that they are loaded immediately but now we do not have any way to perform custom validation that we normally do via AP_INTERFACE_WORKFLOW_PKG.do_custom_validation procedure.
    Is there any way to modify how iSupplier portal inserts Invoice data into AP tables? In particular we would like to choose specific document category for certain suppliers.
    Many thanks in advance,
    Kamil

    Hi Friends,
    Apologies to have put this in SCM-Costing Category. I just posted the same thing in Financials Category.
    Please ignore this, if found irrelevant under this category.
    Thanks,
    AAR

  • Problem with custom validated data types using domain on 11g

    Hi,
    I ' m on a migration process from 10 to 11 and I notice that a custom domain didn't work correctly anymore
    to be more specific every time that I was submiting a page a was getting an error cannot convert from myclass to oracle.jbo.domain.String
    I search the forum and I saw a similar problem
    Cannot convert type class java.lang.String to class oracle.jbo.domain.Clob
    at which Frank says that it is a known bug and suggests a work around.
    I use the workaround and it worked but some more issues came up:
    1. If the validation fails I get the error that I throw at the validate method not in a popup with just my message
    but in the whole window with the whole error stack, meaning that my custom validation is not handled like native ADF validation errors by
    the framework (at 10.1.3.4 worked OK)
    2 If i dont give a value at the attribute in the validation phase mdata variable is not null but is length is zero (at 10.1.3.4 its value was null)
    public class AFM implements DomainInterface, Serializable {
    public AFM(String val) {
    mData = new String(val);
    validate();
    private String mData;
    protected void validate() {
    // ### Implement custom domain validation logic here. ###
    mData==null // returns false
    mData.length()==0 // returns true
    3. Can i force validation only for new or updated values? I saw that the validation process is taking place every time a row is fetched.
    This is not only a performance issue, the bigger problem is that if a fetched from the DB value fails the validation an error is return but the
    user cannot change the value to correct it.
    TIA
    Tilemahos

    since i don't get any answer I wonder if i should have use a more provocative title like
    "custom domains in 11g don't work"
    is it true?
    Tilemahos

  • Custom Validator Class not found in Class Path

    I have developed a custom validator class for User Self Registration request. However, when OIM is unable to find the custom validator class and generates teh following error:
    [oracle.iam.platform.pluginframework] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: oiminternal] [ecid: 76584c4849877d50:-45bb4068:13c8294bd72:-8000-0000000000001236,0] [SRC_CLASS: oracle.iam.platform.pluginframework.InternalStore] [APP: oim#11.1.1.3.0] [SRC_METHOD: getPluginInstance] Not able to load class com.infotech.tra.CustomValidator.SelfRegisterUserCustomValidator from classpath
    At what path should the jar file be placed?
    UZ

    I am running the plugin registration utility but it generates the error mentioned below. I have verified the structure of my zip file and the structure of zip file is:
    -> SelfRegisterUserCustomValidator.zip
    ->Plugin.xml
    ->/lib/SelfRegisterUserCustomValidator.jar
    ->/resources/
    Following our contents of plugin.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <oimplugins>
    <plugins pluginpoint="oracle.iam.request.plugins.RequestDataValidator">
    <plugin pluginclass= "com.infotech.tra.CustomValidator.SelfRegisterUserCustomValidator" version="1.0.0" name="SelfRegisterUserCustomValidator">
    </plugin>
    </plugins>
    </oimplugins>
    Following is the error being generated:
    Enter name (complete file name with path) of the plugin file:
    /u01/oracle/Middleware/Oracle_IDM1/server/plugin_utility/SelfRegisterUserCustomValidator.zip
    [java] Java Result: 1
    [echo] Exception in thread "main" java.lang.NoClassDefFoundError: oracle/iam/platformservice/utils/PluginUtility
    [echo] Caused by: java.lang.ClassNotFoundException: oracle.iam.platformservice.utils.PluginUtility
    [echo] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    [echo] at java.security.AccessController.doPrivileged(Native Method)
    [echo] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    [echo] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    [echo] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    [echo] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    [echo] Could not find the main class: oracle.iam.platformservice.utils.PluginUtility. Program will exit.

  • Custom validation Messages printed more than once :-(

    Hi,
    I have added a Custom Validator to a drop down list box (h:selectOneMenu) and for a text field. and i bound these form elements to the corresponding UIComponent Object in the becking bean. The backing bean is in session scope I have a link which will forward to a different page and i disabled the validation on this link by setting immediate as true.
    But when the user clicks the command link goes second page and then comes back to the first page and click the submit button, the validation error occurs. But to my surprise i am getting the same Validation error message printed twice or thrice (as when we are going to the second page and then comes back and submits).
    If I am correct the Validator corresponding to the component keeps the old error state and then add the new error state.
    I tried to remove one FacesMessage object which i got from Iterator of FacesContext.getMessages() and then tried. but hence also i was getting the same result.
    When i looked at the log, i foud my validator class being invoked twoce (or thrice depending upon the no. of times i went to the secoond page).
    Can you please help me out from this problem?
    Thanking you,
    Sudheesh

    If it is indeed 1.1, I'd recommend trying 1.1_02 [1] and trying again.
    [1] https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=5225&expandFolder=5225&folderID=5220

  • How do you create custom validation rule in WS 9.2?!?!?!

    Hello,
    I am using Workshop 9.2. I created a page flow, and want to do some form validations.
    I saw the simple 9.2 example, but it is only good for very basic validation, what if you have to validate the form field against a database, must you write a custom validation rule? HOW would you do this in 9.2 so that will still stay with the workshop/netui paradigm?
    http://beehive.apache.org/docs/1.0.1/netui/validation.html
    Keith

    Hi Keith,
    Staying within the declarative validation framework the answer is probably that you do need to write a custom validation rule and refer to it using the @Jpf.ValidateCustomRule annotation.
    The NetUI Annotation Reference shows how the Struts validations are supported via the framework.
    http://beehive.apache.org/docs/1.0.1/netui/annotations/pageflow_annotations.html
    Specifically, if you look through the @Jpf.Validate* annotations, while most of these are "canned" common validations, there are a few that are more open-ended, such as @Jpf.ValidateMask and @Jpf.ValidateValidWhen.
    Those two let you write the validation logic in the annotation while @Jpf.ValidateCustomeRule only refers to a custom rule in the struts validator file.
    In any case, there is a validation rule editor which should help in authoring and managing the annotations. In the Page Flow Explorer or Page Flow Editor just right click on the action or form bean bean of interest and choose Validation Rules and the appropriate scope.
    I hope that's of some use,
    Troy

  • Custom Validator for a Custom Component

    I am having troubling passing values from my custom component
    to my custom validator (via a model). For some reason when the
    validate() function is called for the validator the value parameter
    passed to the validator is not showing the value from my custom
    component.
    I have attached some example code to illustrate.
    Here is my model:
    <mx:Model id="myModel">
    <root>
    <mod>
    <name>{myTextInput.text}</name>
    <date>{myDateField.selectedDate.getTime()}</date>
    <length>{myComp.getLength()}</length>
    </mod>
    </root>
    </mx:Model>
    When I update the value of myTextInput or myDateField the
    model (as sent to the validator) shows the correct value. When I
    change the value of myComp the change is not reflected.
    Is there a particular event (or something) being dispatched
    in the other components to cause the model to get the new value
    that I need to include in my custom component? I am pretty stuck
    and would appreciate any help.
    Many thanks

    Does myComp extend EventDispatcher (or any class which does)?
    You need to flag the getLength() function as bindable and to
    dispatch an event:
    [Bindable('getLengthChange")]
    public function getLength() : Number
    // does whatever it does
    When you update myComp have it dispatchEvent( new
    Event("getLengthChange") ) and I think it will work.

  • How to use I18N with a custom validator?

    This is my custom validator:
        public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
            Pattern pat=Pattern.compile(".+@.+\\.[a-z]+");
            Matcher m= pat.matcher(value.toString());
            if(!m.find())
                FacesMessage message = new FacesMessage("Not a valid e-mail address");
                throw new ValidatorException(message);
        }Instead of providing the text "Not a valid e-mai address", I'd like to get the text out of my ApplicationResources property file.
    How can I do this?
    I know how to use it with the provided validators, but not with own custom ones
    Please help me out, thanks

    I found a solution for this problem, I don't know it's best practice but here it is :
        public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
            String errortext;
            Pattern pat=Pattern.compile(".+@.+\\.[a-z]+");
            Matcher m= pat.matcher(value.toString());
            if(!m.find())
                ResourceBundle bundle =
                ResourceBundle.getBundle("be.vdab.resources.ApplicationResources", context.getViewRoot().getLocale());
                errortext = bundle.getString("erroremail");
                FacesMessage message = new FacesMessage(errortext);
                throw new ValidatorException(message);
        }

  • Can we apply custom validation before uploading data in WebADI in 12.1.3

    Hi,
    I have requirement of applying custom validation before uploading data from spreadsheet using webADI. How can we do that.
    Is there any way in desktop Integration Manager Responsibilty in WebADI.
    I have just started exploring webADI
    Please Help Me...
    Thanks,
    Suhani

    Why are you posting this in OAF?
    Anyway you can by creating a custom PL/SQL wrapper that is called by the WebADI.
    Raise an application ERROR in your wrapper and it will show in the WebADI
    If you just want to validated VALUES, you are better of creating an LOV on the Column. Then WebADI will do the validation work for you.
    Jeroen

  • Custom Validation in ESS Edit Screen

    All,
    We have a requirement in ESS Address screens that all country users should key in only English Data. We are in SAP ESS SP12 and all the Address Components are in WD Java. The validation on all the address screen fields for this requiement has to be handled and give an error message back to the user.
    The Options that I Checked out were:
    1) Handling the Validation through BADI HRPAD00INFTYUI or HRPAD00INFTYBL.
    2) Handling the validation in WD Java layer inside the country spoecific components isConsistent method of the Detail View Component controller
    Which is the best place (ABAP or JAVA) to handle Custom validations on the Edit Screen and give back message to the user? Please suggest if any other better options are available other than the above mentioned ones.
    Regards,
    Nagarajan.

    Hi,
    Both are doable if you are good in java and have NWDI ,handling validations in the wd java layer is easy. If you are good in ABAP you can handle in ABAP.It depends on how you write your code, if you do validations in java and if your validation fails you can show errors to user right away which will reduce your call to backend at isconsitent method for checking the errors.
    Thanks,
    pkv

  • Custom Validation Routine not getting triggered

    Hi,
    I need some information regarding the Validation Routines that is maintained in SPRO.
    I created a validation routine and activated it. And also I maintained all the configurations needed. But when I create an ASN in VL60, the program control is not going inside the validation routine that I created.
    When I checked the program /SPE/RTS, I found that it contains all the SAP Std validation routines except the routine that I created. I believe that an entry need to be created automatically in the program /SPE/RTS when activarte my custom validation routine, which is not happening.
    Does any one else has faced this issue before? Thanks a lot in advance.....
    Thanks & Regards
    Sreeraj Pulickal

    Vinod,
    I do have a separate client for testing and I had moved all the changes from DEV to Testing client. But since no entry has been created in program /SPE/RTS for my custom validation routine in DEV, there is point in moving all the changes. The validation routine won't get triggered.
    So I created an implicit enhancement in /SPE/RTS to include my validation routine. I'm not sure whether this is the right approach, but it solved my problem.
    Thanks
    Sreeraj.

  • Implementing Custom Validation Logic for Payment Disbursements

    Hi All,
    Is there anyone here, who has implemented Custom Validation Logic for disbursements in Oracle payments.
    Theory: Under Payments Setup Administrator -> Formats -> Formats, we can setup a payment format and even attach a XML template. Apart from this we can setup Pre-defined validations or user Defined validations.
    For Pre-defined validations / seeded validations, Oracle has provided an API
    IBY_VALIDATIONSETS_PUB.evaluateCondition. We can use this API, and call a custom package by using the keyword 'CUSTOM' in the call.
    Has anyone played around with this package and successfully implemented custom validations. Does anyone have a sample code on how to implement this. The Payment Manager Implementation guide is of little help.
    Thanks

    This document was very helpful to me in creating a custom validation.
    http://docs.oracle.com/cd/E18727_01/doc.121/e13416/T387353T419293.htm

  • Custom validator for a SelectMany component

    I did not succeed at validating a selectManyCheckBox with a custom validator.
    I want to validate that the user selected at least 1 and at most 3 checkboxes.
    The UIComponent.getSelectedValues always returns an array of length 0, even when some boxes are checked.
    Page code:
         <h:selectManyCheckbox id="selectProfessions" value="#{userBackingBean.selectedProfessionIDs}" layout="pageDirection" styleClass="category">
              <f:selectItems value="#{categoryTreeBackingBean.professionSelectItems}" />
              <f:validator validatorId="com.studio184.news.ui.validator.SelectCategoriesValidator"/>
         </h:selectManyCheckbox>
    Validate method:
    UISelectMany select = (UISelectMany)component;
    if (select.getSelectedValues() == null || select.getSelectedValues().length < 1 || select.getSelectedValues().length > 3) {
         String summary = ...
         String detail = ...
         FacesMessage message = new FacesMessage(summary, detail);
         message.setSeverity(FacesMessage.SEVERITY_ERROR);
         throw new ValidatorException(message);
    Any help would be greatly appreciated.
    Bruno
    http://www.practicalsoftwarearchitect.com

    In general, the value property is set at the end of the Process Validations phase.
    You can use getSubmittedValue() to access the submitted values.
    More simply, you can use the third argument of the validate method which is the same as the submitted value.
    For example:
    public void validate(FacesContext arg0, UIComponent arg1, Object arg2)
              throws ValidatorException {
         Object values[] = (Object [])arg2;
         if (values() == null || values().length < 1 || values().length > 3) {
         // throw exception!!
    }

  • OIM Custom validation on entitlement request submission.

    Hi,
    We have a requirement in OIM to do some custom validation on entitlement request submission through catalogue.
    Can we leverage the requestdatavalidator here. Is there any other way of doing it?
    Thanks in advance,

    What you would need to do is create a controller to allow for this functionality to occur. the processformrequest procedure is the best one to achieve this functionality. Once you have written the custom validation, personalize the page you need the control on and add in the controller.

  • How can i get localecontext within customer validator?

    Hi,
    I want to localize my error message ,so I need to get entity attribute label
    within customer validator,I write code as follows( eo is entityImpl object eo=valCtx.getSource();)
    String attributeLable=eo.getStructureDef().findAttributeDef(tempAttrName).getUIHelper().getLabel();
    but getLabel need localeContext parameter,How can I get it or where can set it ?
    thanks very much
    lixz
    2006/12/5

    Hi,
    try this:
    DefLocaleContext dlc = new DefLocaleContext();
    String attributeLable=eo.getStructureDef().findAttributeDef(tempAttrName).getUIHelper().getLabel(dlc);

  • Database and ejb access in Input Processor, custom Validator

    Hi guys,
    I know the Portal docs recommend that database and ejb calls should be done in
    a Pipeline Component. Are transactions the only concern?
    I'd like to validate two fields. This can be easily accomplished by a an ejb
    method call that returns a boolean for one, and by running a simple select statement
    for the other. Are there any risks to creating custom validator classes to do
    this?
    Thanks

    David,
    Here are the characterstics of Pipelines and IPs:
    Inputprocessors:
    - Web App scope (classloaded by webapp classloader)
    - simple java class
    Pipelines/Pipeline Components:
    - Enterprise App scope (available to all webapps)
    - java class or EJB
    - can be transactional (can even rollback PipelineSession)
    - Pipelines executed from within the EJB container
    There is nothing illegal about putting EJB calls and JDBC calls into an Inputprocessor.
    For simple validation, this is probably okay. However, when doing heavy business
    logic, having the Pipeline manage a single transaction for your PCs is wonderful.
    PJL
    "David Sun" <[email protected]> wrote:
    >
    Hi guys,
    I know the Portal docs recommend that database and ejb calls should be
    done in
    a Pipeline Component. Are transactions the only concern?
    I'd like to validate two fields. This can be easily accomplished by
    a an ejb
    method call that returns a boolean for one, and by running a simple select
    statement
    for the other. Are there any risks to creating custom validator classes
    to do
    this?
    Thanks

Maybe you are looking for

  • Essbase port issue

    I have one doubt regarding Essbase ports usage. If I define 1000 to 2000 ports range for Essbase Server in config file-. If some other application (Not Essbase) is running one of these port say 1200- I start my Essbase server.. one application tries

  • Promotions with Macs

    First of all I hope that this thread is posted in the correct section. I am hoping to place the order on a new MacBook tomorrow so that I may recieve it before I start school on Monday. =\ Before I place this order, I would like to be sure of certain

  • JLayeredPane alternative for SWT

    Hi there, I have recently started working in SWT, have been long working in Swing. I post this question here since I didn't find any specific forum for SWT queries, which btw I think is the need of the hour. SWT definitely calls for a separate dedica

  • 15" Macbook pro (late 2010) shuts down randomly! HELP!

    hey guys, i bought a 15" macbook pro core i7 late 2010 model a few years back, and i havent had a problem with it until now, it shuts off randomly and then when turning it back on it dsays "macbook shut down because of a problem" . NOW,  I dont know

  • I paid for upgrade on iphoto, now i can not get iphoto back after deleting it

    i lost up grade on iphoto.  now can not get it back.  the computer tells me that my mac system needs to be greater than what i have.  i need iphoto.