Validation: Two items cannot be null or filled at the same time

Hello forum members,
I have a question about item level validation and was hoping someone would be able to shed some light on my problem.
I'll go into a quick background of what the app does first so you will have an idea of what I'm trying to get at (or if you can suggest a better approach).
Our team, on a regular basis, receives records that require analyzing. Over the years, we've compiled a pretty good list of possible analyses for any record. We used to do this by manually going into sql developer and changing the analysis in the analysis field, but that posed problems of spelling mistakes and other human errors.
I've created a front end application that will scrape all possible analyses from the table into a drop down menu thus limiting the amount of human input as possible. The problem here is that as things grow, there will always be a new problem that does not fit the analysis we have used in the past. So I would like to give the ability for the team to use a text field to enter a new analysis for those cases (and then subsequent records can find it in the drop down menu).
The two application items used in this problem is: p_select_list and p_text_field.
In my first iteration of this application, I added an extra value in p_select_list called "Other". Some nifty javascript would check to make sure that if anything but "Other" was selected, p_text_field would be disabled (there was a problem with that where on page load, the field would be enabled even though "Other" wasn't selected).
We've been having some javascript issues while migrating our application from development to testing to production, so I would like to avoid javascript unless there really is no other option.
What I'm trying to implement now is a page level validation on both p_select_list and p_text_field to test to make sure that either p_select_list is not null or p_text_field is not null.
I know there are 3 cases to test for (both null, both not null and only one is null), so I used a function returning boolean validation.
I started off small and just had the following:
if ((p_select_list is not null) and (p_text_field is not null)) then
return true;
else
return false;
end if;
I then chose something in the select list and entered some garbage in the text field and hit submit. The validation worked like a charm!
Now I added the both null check:
if ((p_select_list is not null) and (p_text_field is not null)) then
return true;
elsif ((p_select_list is null) and (p_text_field is null)) then
return true;
else
return false;
end if;
However, I go into a record and enter something into the select list and leave the text field blank, and it throws the error at me. Then I tried both items as null and that breaks too. However, I can't say that this is the work of the script since it failed the one case it wasn't supposed to.
Do you know what I'm doing wrong here? Is there some way for APEX to ensure that only one of the two fields has a non-null value?
Thank you in advance,
Ivan
Edited by: ichin on Jan 28, 2009 3:40 PM

Hi Ichin,
I am a bit confused with your statement -
if ((p_select_list is not null) and (p_text_field is not null)) then
return true;
elsif ((p_select_list is null) and (p_text_field is null)) then
return true;
else
return false;
end if;Here this statement -
if ((p_select_list is not null) and (p_text_field is not null)) then
return true;returning the result TRUE when both fields are not null
And this statement -
elsif ((p_select_list is null) and (p_text_field is null)) then
return true;returning the result TRUE again when both fields are null. If you see closely basically is not validating becoz it returning true whatever the input is.
I do not know what you want to use the second statement when you have else statement at the end. It will return false if one or both fields are null unless you want to validate either text field.
Hope this make sense.
Regards,
M Tajuddin
web: http://tajuddin.whitpeagesbd.com

Similar Messages

  • I cannot use data and voice at the same time.

    I cannot use data and voice at the same time.
    I am on Wifi (connected) and at the same time I am on a voice call. when I switch to my RSS feed reader it does not sync it comes out with a message cannot connect to internet, I thought it is a problem with the feed reader application, IE 10 behaves the same I cannot browse when I am on a voice call.
    This is a very basic issue, am I missing something? Please help.
    My Model is lumia 820 with the latest portico update.
    TIA
    Sandeep

    I am aware that packet data via EDGE and voice cannot happen at the same time, surprisingly when I am on voice call I cannot connect to internet via Wifi too

  • I want to connect two pair for earphones to my IPAD at the same time is there a recommended splitter or amplifier I should use?

    I want to connect two pair for earphones to my IPAD at the
    same time is there a recommended splitter or amplifier I should use? 

    tracer took the words out of my mouth.  Doing the search I found this one amongst many others.
    http://store.apple.com/us/product/HA828ZM/A/belkin-audio-splitter-35mm-m2x35mm-f

  • (please urgent) two web modules , but only one run at the same time

    Hi sirs;
    In jDev 11g, I've a project with two viewControler fusion Adf and one model ( service bc4j ) ;
    When i Deploy the application using the topmost drop down list from jDev Ide ( application drop down list), only one of the two application works simultaneously.
    Look , the two applications works, but they do not work at the same time.
    stack trace like :
    zip:C:/Users/t/AppData/Roaming/JDeveloper/system11.1.1.1.33.54.07/DefaultDomain/servers/DefaultServer/tmp/_WL_user/PlanejamentoRH_V2.0/ebw81b/war/WEB-INF/lib/_wl_cls_gen.jar!/view/DataBindings.cpx
    25/09/2009 15:56:25 oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImpl setLifecycleContextBuilder
    INFO: ADFc: Inicializando Ciclo de Vida da Página do ADF para o ambiente JSF, LifecycleContextBuilder é 'oracle.adfinternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
    25/09/2009 15:56:25 UNEXPECTED_CLIENT_OBJECT_TYPE oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    SEVERE: oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    25/09/2009 15:56:25 UNEXPECTED_CLIENT_OBJECT_TYPE oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    SEVERE: oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    25/09/2009 15:56:25 UNEXPECTED_CLIENT_OBJECT_TYPE oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    SEVERE: oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    <25/09/2009 08h56min13s AMT> <Error> <HTTP> <BEA-101020> <[ServletContext@7863650[app:PlanejamentoRH module:ORHQVagas path:/ORHQVagas spec-version:2.5 version:V2.0]] Servlet failed with Exception
    javax.el.PropertyNotFoundException: Target Unreachable, identifier 'controlerBean' resolved to null
         at com.sun.el.parser.AstValue.getTarget(AstValue.java:67)
         at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:126)
         at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:230)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.getReadOnly(EditableValueRenderer.java:400)
         at oracle.adfinternal.view.faces.renderkit.rich.FormElementRenderer.renderAsElement(FormElementRenderer.java:211)
         Truncated. see log file for complete stacktrace
    >
    Is thrown , just when we try to browse the second application( the first one is ok , up and working );
    No metters , whose of the two applications is browse first , every the first work and the second fail;
    I've made other very simple application with two projects and the two worked well, at the same time, but the real project is giving me this problem;
    If someone could point me to some white-paper or give me some tips , I'll appreciate very much;
    Fowards Thanks;
    Marcos Ortega
    Brazil

    I reproduce it here;
    I Just relocate  the DataBindgs.cpx   to view/foo/DataBinds.cpx  and rename the view_view1PageDef to  view_foo_view_view1PageDef  and it's Works;
    Please muhammed, it is related with mds / ADF Security Configuration ?
    I was sure , that it will not work , in my thoughs "UNEXPECTED_CLIENT_OBJECT_TYPE" was throne because the second application should not be able to create a second instance of appModule because GUID problems ;
    As a metter of fact, it was raised again , but the page and all data was displayed;
    Lets see the log;
    Target URL -- http://127.0.0.1:7101/Application2-ViewController1-context-root/faces/view1.jspx
    09/10/2009 08:58:21 oracle.jbo.uicli.mom.CpxUtils$Visitor logMainApplicationCpx
    INFO: file:/C:/Users/t/AppData/Roaming/JDeveloper/system11.1.1.1.33.54.07/o.j2ee/drs/Application2/Application2-ViewController1-webapp/WEB-INF/classes/view/foo/DataBindings.cpx
    09/10/2009 08:58:22 oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImpl setLifecycleContextBuilder
    INFO: ADFc: Inicializando Ciclo de Vida da Página do ADF para o ambiente JSF, LifecycleContextBuilder é 'oracle.adfinternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
    09/10/2009 08:58:25 oracle.adf.share.jndi.MDSBackingStore isReadOnlyMDSStore
    INFO: Read only backing store
    *09/10/2009 08:58:28 oracle.jbo.uicli.mom.JUApplicationDefImpl logCpxUsageIdCollision*
    SEVERE: Both view.foo.DataBindings.cpx and view.DataBindings.cpx use the same usageId: view_view1PageDef
    FIX: Use view_foo_view_view1PageDef as the usageId in view.foo.DataBindings.cpx
    09/10/2009 08:59:27 oracle.jbo.uicli.mom.CpxUtils$Visitor logMainApplicationCpx
    INFO: file:/C:/Users/t/AppData/Roaming/JDeveloper/system11.1.1.1.33.54.07/o.j2ee/drs/Application2/Application2-ViewController-webapp/WEB-INF/classes/view/DataBindings.cpx
    09/10/2009 08:59:28 oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImpl setLifecycleContextBuilder
    INFO: ADFc: Inicializando Ciclo de Vida da Página do ADF para o ambiente JSF, LifecycleContextBuilder é 'oracle.adfinternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
    *09/10/2009 08:59:28 UNEXPECTED_CLIENT_OBJECT_TYPE oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl*
    SEVERE: oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    09/10/2009 08:59:30 oracle.adf.share.jndi.MDSBackingStore isReadOnlyMDSStore
    INFO: Read only backing store

  • How can I use my IPAD to stream Musik to two Air Port Clients in a network at the same time?

    I want to stream my musik via I PAD to more than one Air Port Clients at the same time. Via MAC it is possible to select "more speaker". In the I PAD I can only select Station 1 or Station 2.

    I opened Airport Utility today and it appears to have been simplified to the point where you can't do much with it these days.
    Yes, welcome to the Fisher Price toy box utility.. where nothing in the way of advanced usage is offered.
    Is there a way to accomplish what I want to do that is reasonably simple?
    You can put time controls onto the offending addresses.
    But if the hackers know anything at all they know how to access the MAC address of the computer and change it.. so the effectiveness of this is limited.
    Change the current setup and password.. You must use WPA2 Personal and I recommend you use a pure alphanumeric password, mix case and numbers of 20 characters or more for your situation.. do not give that password to anyone.. protect the admin password of the TC itself equally well but with a different password. And protect the physical access to the TC from anyone in your home.. because the fact is all security on the TC is an illusion if the TC has open access.
    See how to find passwords here.
    i forgot my password for my router, how can I change them.
    So anyone can discover your passwords without your knowledge and leave no trace on your system.
    If you make no progress.. I suggest replacement of the TC as the main router of your network.. you need something with controls.. and even better controls that allow you to block people.
    The favourite one now is older Netgear WNDR3800 . .you might need to buy from ebay although a few new ones are still around.. alternatively the WNDRMACv2 is simply the same hardware in a white box.. instead of black.
    Load gargoyle firmware onto it.. sorry if I even point to where you can find this info my post will be deleted.. I can say it.. just cannot help further.. so use google.. there are lots of posts and let me assure you this get combo.
    You can continue to use TC at what it does best.. a dumb wireless AP and location for TM backups.

  • Satellite P100: Can I connect two external monitor to VGA & DVI port at the same time?

    The Satellite P100 comes with two external monitor port. A VGA and a DVI. Can you have have two external monitor working at the same time? Can you have two external monitor as well as your internal display working at the same time (for a total of 3 display at the same time?
    Here is what I have confirm:
    Internal display + DVI connector display
    OR
    Internal display + VGA connector display
    Is it possible to have:
    DVI connector display + VGA connector display?
    OR
    DVI connector display + VGA connector display + Internal display?

    As far as I know this is not possible and you can use either DVI or VGA port.
    For signal output can be used only one port for external display.

  • Cannot open 2 Virtual Machines at the same time to access the same Database

    Folks,
    Hello.
    I am installing Oracle Database 11gR2 RAC system using 2 Virtual Machines (rac1 and rac2) on the top of VMPlayer 3.
    The VM rac1 and rac2 run correctly when one of them is shutdown.
    Their locations are F:\VM_RAC\rac1 and F:\VM_RAC\rac2.
    While rac2 is running, I open rac1. But this error message comes up:
    Error: "Cannot open the disk F:\VM_RAC\sharerac\asm1.vmdk or one of snapshot disks it depends on. Reason: failed to lock the file."
    While rac1 is running, I open rac2. But this error message comes up:
    Error: "Cannot open the disk F:\VM_RAC\sharerac\asm1.vmdk or one of snapshot disks it depends on. Reason: failed to lock the file."
    The 2 error messages are the same. This means I cannot open 2 VMs rac1 and rac2 at the same time. When we run RAC system, we have to open 2 machines or more than 2 machines at the same time so that all machines can access the same Database Server.
    My question is:
    Can any folk tell me how to have rac1 and rac2 run at the same time ?
    Thanks.

    You need to disable disk locking, which ordinarily is performed by the first VM to prevent any other VMs from corrupting your vmdk files via uncoordinated writes. You will have to shutdown both of your VMs and edit the *.vmx flat file for each, adding lines like the following (settings taken from workstation 6, but should be nearly identical settings for VM Player 3.x):
    http://crosbysite.blogspot.com/2007/10/clustering-in-vmware-workstation-6.html
    scsi1.sharedbus = "Virtual"
    disk.locking = "false"
    diskLib.dataCacheMaxSize = "0"
    diskLib.dataCacheMaxReadAheadSize = "0"
    diskLib.dataCacheMinReadAheadSize = "0"
    diskLib.dataCachePageSize = "4096"
    diskLib.maxUnsyncedWrites = "0"
    A few comments:
    - your shared disks (scsi1) must be on a separate virtual scsi bus than the boot disk (scsi0), to allow setting the sharedbus flag as seen above.
    - you must also ensure the cache parameters and unsynced writes settings are set to guarantee that all IO is immediately flushed to the vmdk file so the other VM can immediately access the latest version of data.

  • If Two Users try to schedule a report at the same time does that lead to a Deadlock?

    When Two users trying to access the same server and need to access the report for scheduling at the same time, does that lead to Deadlock Situation?
    What are the Odd's in such scenarios?
    Please help me understanding.
    Regards,
    Shiva

    When two users are say trying to schedule the same report at the same time - the relevant Job server has default capacity of running 5 concurrent jobs at a time (this value can be increased) - that means, it can run 5 schedules at the same time.
    Let's say now two users have scheduled 6 reports - now the 5 reports that were scheduled will be in the "running" state but the server has only 5 concurrent job capacity so the 6th report schedule will stay "pending" until any one of the existing jobs are completed, and then the 6th report will start "running".
    There is nothing called deadlock while scheduling. While viewing the reports, there are enough resources available in the BO system to make the report available for various users at the same time.
    Thank you,  Rahul

  • My new Apple TV 2nd generation and computer cannot to my Airport Express at the same time, whats up?

    My Airport Express wont allow both my computer and new Apple TV to be conected at the same time. In Network Preferences I have to manually connect my Apple TV and when I do then it disconnects my computer. When I go to Network Preferences to manually connect my computer it disconnects my Apple TV. Both cannot be connected at the same time. Whats the fix?

    I've tried to set up the IP's manually, still doesn't work. In fact I get a message saying that there is another device trying to use my computers IP address of 00.0.0.0. Thats not my computers IP its my Airport IP. Then neither my computer nor my Apple TV can connect. I change things back to auto configuation its either the Apple TV or the computer which I have to change in Network Preferences. It even tells me that my computer is connected to my network in the status bar and in Network Preferences when it is not. I never had this problem with my old Apple TV (1st).

  • Users cannot have iPhoto 11 open at the same time

    I am having the problem that if both my Wife and I are logged in, we cannot both have iPhoto 11 open at the same time. We have separate libraries, so it's not a library sharing issue. I thought it might be a permission issue, so I:
    1)copied both libraries to an external Fat32 drive to get rid of the permissions,
    2)then copied them back to the Mac,
    still could not open my iPhoto if she had hers open and vice versa.
    I wanted to eliminate all possible permission problem possibilities, so I:
    1)re-formated the mac,
    2)and did a fresh install of 10.6 off the retail DVD,
    3)applied all updates,
    4)and installed iLife 11 off the retail DVD.
    I then just opened iPhoto under her account, created a new library, then tried the same under my account, and it still would not open. I just get the grey window with a pin wheel for hours.

    Dear, you're not alone.
    i've also open a topic on this problem. :
    http://discussions.apple.com/thread.jspa?threadID=2630415
    good luck ...
    Message was edited by: YOS06

  • Using two Desktop Macs with HP LP2475w monitor at the same time?

    Hello,
    I was curious to know if anyone knows if I can use this monitor with a 2010 MAC and a G4 MAC from about 10 years ago at the same time? There are many ports on the HP monitor that can possibley be used simataneously? I am worried this will damage the video card on the MAC(s) that I have. I have a feeling I have to switch one off and use the them one at a time.
    The reason I am asking is that I have an old Nikon Coolscan 4000 fim scanner and Nikon for some crap reason has never updated their Nikon software for the INTEL Macs. (oh... they think film is dead and no one has 1000's of slides) but the scanner will work on my G4 Mac. I don't want to continoulsy turn off one MAC and turn on the other.
    Thank you

    Here's the Wiki definition of a "KVM Switch".  But briefly, yes, you can switch among computers use a common keyboard, video, and mouse on the fly, hence the name "KVM".  2-port KVM's are for two systems but KVMs do exist to handle more than 2 systems (at a higher cost of course).
    I would google searches for "DVI KVM" and/or "Displayport KVM".
    If I were doing this at this I would probably be looking for DVI's as opposed to Displayport not for any real technical reasons but only because on my mac I have mini-displayports and a DVI port so I am currently familiar with the kinds of adaptors, cables, etc. involved.  I haven't needed to deal with a full sized displayport but I imagine there's suitable cables and adapters for that too.  I suspect the deciding factor would come down to cost as to which kind to use.

  • Cannot download content and play at the same time

    Hello Again,I am not sure if this is thanks to the last update but during this week I have not been able to download a game and play others game at the same time.I leaved the game downloading then went to play something (online or campaign) and a couple of minutes later the game that I was downloading appear with an error cannot download, error connection etc.I checked my network and is fine, even purchased a new router with the same results.Is somebody else experiencing this problems or know a solution for this?

    Hello Apparently the problem was the game I was downloading i downloaded 2 games today an no error

  • Can two people update a single Pages document at the same time like with Google docs?

    Is it possible for two different users to concurrently update an iWork document (pages/numbers/presentation) that resides on the iCloud?

    That I don't know swithout testing.
    My suspicion is that both users probably can open the same document but there will be conflicts when saving. Last one in gets to overwrite the others work.
    There is nothing in place that I know of that arbitrates access.
    Peter

  • Two people can open one InDesign file at the same time

    We have Mac (10.8.5) users who share files on a file server. They are connected to the file shares via NFS. The users are using Creative Suite 5.5. When a user opens a file, they get the appropriate ".idlk" lock file. For example:
    ~test~0kjyv(.idlk
    TEST.indd
    As far as I used to know, this used to prevent anyone else from opening that same file. But now, multiple users can open the same file. Whoever makes the first save seems to win. The next person who tries to save the file will get the following error:
    "Another user has modified the Adobe InDesign document TEST.indd. To prevent damage to the document, InDesign is shutting down."
    InDesign then locks up and starts beachballing. The only option is to force quit.
    I tried updating the users to the latest version of CS5.5 InDesign which is 7.5.3.
    Has anyone else encountered this?
    Thanks,
    Rob

    Maybe it is something to do with using NFS? Our Mac's are bound to AD, and use NFS shares because they have issues with SMB/CIFS. They are connecting to an EMC NAS. All of the users have read/write permissions to the files.
    I tried the same process on a test AFP share that I created from a Mac OS X Server, and then it works as expected. When the second user tries to open the file, they cannot, and they get an error message:
    "Cannot open the document TEST.indd. You may not have permission or the document may be open already."
    Why doesn't it behave this way on the NFS share?
    The permissions look comparable for each:
    NFS share:
    -rw-rw-r--@  1 ADuser  ADgroup   6823936 Oct 29 16:17 TEST.indd
    -rw-rw-r--@  1 ADuser  ADgroup        0 Oct 30 09:37 ~test~0kjyv(.idlk
    AFP share:
    -rw-rw-r--@  1 admin    staff          6823936 Oct 30 09:33 TEST.indd
    -rw-rw-r--@  1 admin    staff               0 Oct 30 09:35 ~test~0kjyv(.idlk

  • TS1559 I have two problems but since they both started at the same time I'm guessing that they are related. My WiFi on/off button is greyed out AND my iCloud Drive (under "Settings") has been "Upgrading" with that spinning download symbol for 2 wks now! N

    I cant be positive but I think this started when my iPhone did an automatic software update. I couldn't get any WiFi connection because when I go to turn it back on the iPhone wont let me and Greys out my WiFi on/off button.
    But also I think something happened to my iCloud connect as well because next to my iCloud Drive under "Settings" it has that spinning symbol that usually denotes waiting for something to finish downloading. But this time it never stopped! Its been spinning saying "iCloud is Upgrading" for 2 weeks now! I have tried the on/off iPhone restart or reset, and I've even put my iPhone into "Recovery Mode" as a last resort. but when iTunes was finished "Restoring" it, nothing had changed; Still Greyed out WiFi button and iCloud is still "Upgrading"! Help please!

    Hi Ichin,
    I am a bit confused with your statement -
    if ((p_select_list is not null) and (p_text_field is not null)) then
    return true;
    elsif ((p_select_list is null) and (p_text_field is null)) then
    return true;
    else
    return false;
    end if;Here this statement -
    if ((p_select_list is not null) and (p_text_field is not null)) then
    return true;returning the result TRUE when both fields are not null
    And this statement -
    elsif ((p_select_list is null) and (p_text_field is null)) then
    return true;returning the result TRUE again when both fields are null. If you see closely basically is not validating becoz it returning true whatever the input is.
    I do not know what you want to use the second statement when you have else statement at the end. It will return false if one or both fields are null unless you want to validate either text field.
    Hope this make sense.
    Regards,
    M Tajuddin
    web: http://tajuddin.whitpeagesbd.com

Maybe you are looking for