validation on shoppingCartPG.ItemTableRN

Hello

I have an obligation to implement the validation on shoppingCartPG.ItemTableRN.

I compare the value in the column quantity quantity Onhand I recover using and throw the error message when the value entered in the quantity column is greater than the quantity of Onhand.

It works very well for a single line, but the validation fails for several rows.

Kindly Guide

OAApplicationModule am = pageContext.getApplicationModule (webBean);

Vo1 OAViewObject = (OAViewObject) am.findViewObject ("PoRequisitionHeadersVO");

OAViewObject vo = (OAViewObject) am.findViewObject ("PoRequisitionLinesVO");

Line PoRequisitionLinesVORowImpl = null;

TXN OADBTransaction = am.getOADBTransaction ();

String ItemId = null;

String OrgId = null;

String SourceType = null;

OARow rw = (OARow) vo.getCurrentRow ();

int fetchedRowCount = vo.getFetchedRowCount ();

RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");

If (vo1! = null)

{

Rw1 OARow = (OARow) vo1.getCurrentRow ();

{if(RW1!=null)}

If (RW1. GetAttribute ("TypeLookupCode")! = null)

{

SourceType = rw1.getAttribute("TypeLookupCode").toString ();

}

If ("Internal". Equals (SourceType))

{

If (RW. GetAttribute ("DestinationOrganizationId")! = null)

{

OrgId = rw.getAttribute("DestinationOrganizationId").toString ();

}

If (RW. GetAttribute ("ItemId")! = null)

{

ItemId = rw.getAttribute("ItemId").toString ();

}

String stmt1 = "start: 1: = XXCUST_ICX_GET_ONHND_QTY." GET_AVA_SUBINV_TRANSACT(:2,:3); end; « ;

CallableStatement cs1 = txn.createCallableStatement (stmt1, 0);

Try

{

CS1.registerOutParameter (1, Types.VARCHAR);

CS1. SetString (2, ItemId);

CS1. SetString (3, OrgId);

CS1. Execute();

String s = cs1.getString (1);

If (vo! = null)

{

If (fetchedRowCount > 0) {}

deleteIter.setRangeStart (0);

deleteIter.setRangeSize (fetchedRowCount);

for (int i = 0; i < fetchedRowCount; i ++)

{

line = (PoRequisitionLinesVORowImpl) deleteIter.getRowAtRangeIndex (i);

String s1 = row.getAttribute("Quantity").toString ();

int s2 = Integer.parseInt (s);

int S3 = Integer.parseInt (s1);

if(S3 > S2)

{

OASubmitButtonBean bean1 = (OASubmitButtonBean) webBean.findChildRecursive ('Save');

bean1.setDisabled (true);

OASubmitButtonBean bean2 = (OASubmitButtonBean) webBean.findChildRecursive ("Checkout");

bean2.setDisabled (true);

pageContext.putDialogMessage (new OAException ("kindly to enter the point where less equals Qty OnHand quantity"));

}

on the other

{

OASubmitButtonBean bean1 = (OASubmitButtonBean) webBean.findChildRecursive ('Save');

bean1.setDisabled (false);

OASubmitButtonBean bean2 = (OASubmitButtonBean) webBean.findChildRecursive ("Checkout");

bean2.setDisabled (false);

}

}

}

deleteIter.closeRowSetIterator ();

}

} catch (Exception e) {}

}

}

}

}

}

Kind regards

Kalai

Kalai,

Its always better if you write the code with variable names and correct alignment.

I modified your code a bit more. [Note If he will also compile]

If you have not yet sorted the issue, you can probably try this. If already sorted, ignore this

        OAApplicationModule am = pageContext.getApplicationModule(webBean);
        OAViewObject headerVO       = (OAViewObject)am.findViewObject("PoRequisitionHeadersVO");
        OAViewObject lineVO         = (OAViewObject)am.findViewObject("PoRequisitionLinesVO");
        PoRequisitionLinesVORowImpl row = null;
        OADBTransaction txn = am.getOADBTransaction();
        String  ItemId    = null;
        String  OrgId     = null;
        String  SourceType = null;
        //OARow lineRow = (OARow)lineVO.getCurrentRow();
        boolean disableCheckout = false;
        if (headerVO!=null)
        {
            OARow headerRow = (OARow)headerVO.getCurrentRow();
            if(headerRow!=null) {
                SourceType = (String)headerRow.getAttribute("TypeLookupCode");
                if("INTERNAL".equals(SourceType))
                {
                    int fetchedRowCount = lineVO.getFetchedRowCount();
                    RowSetIterator deleteIter = lineVO.createRowSetIterator("deleteIter");
                    if (fetchedRowCount > 0) {
                        deleteIter.setRangeStart(0);
                        deleteIter.setRangeSize(fetchedRowCount);
                        for (int i = 0; i < fetchedRowCount; i++)
                        {
                            OARow lineRow = (PoRequisitionLinesVORowImpl)deleteIter.getRowAtRangeIndex(i);

                            OrgId = (String)lineRow.getAttribute("DestinationOrganizationId");
                            ItemId = (String)lineRow.getAttribute("ItemId");

                            String stmt1 = "Begin :1:=XXCUST_ICX_GET_ONHND_QTY.GET_AVA_SUBINV_TRANSACT(:2,:3); end;";
                            CallableStatement cs1 = txn.createCallableStatement(stmt1, 0);
                            try
                            {
                                cs1.registerOutParameter(1, Types.VARCHAR);
                                cs1.setString(2, ItemId);
                                cs1.setString(3, OrgId);
                                cs1.execute();
                                String s = cs1.getString(1);

                                String s1 = lineRow.getAttribute("Quantity").toString();

                                int s2 = Integer.parseInt(s);
                                int s3 = Integer.parseInt(s1);
                                if(s3 > s2)
                                {
                                    disableCheckout = true;
                                }
                            }
                        }
                    }
                    deleteIter.closeRowSetIterator();
                    OASubmitButtonBean checkOutBean = (OASubmitButtonBean)webBean.findChildRecursive("Checkout");

                    if(disableCheckout) {
                        checkOutBean.setDisabled(true);
                        pageContext.putDialogMessage(new OAException("Kindly enter the Item Qty Less than or Equal to OnHand Qty"));
                    }
                    else {
                        checkOutBean.setDisabled(false);
                    }
                }catch(Exception e) {
                    System.out.prinln("Exception : " + e.toString());
                }
            }
        }

See you soon

AJ

Tags: Oracle Applications

Similar Questions

  • To update to OS Sierra, I need to enter a valid credit card, even if it's free?

    I have moved countries and not to use a credit card. To update to OS Sierra, I need to enter a valid credit card, even if it's free?
    What is happening with this? I'm more a person worthy enough to upgrade? I upset the bank accounts of the billionaires who benefit from knowing my account information?

    < re-titled by host >

    Create or use your Apple ID without a mode of payment - Apple Support

  • Feed not validating with iTunes more podcast

    My podcast feed is http://www.debozarko.com/feed/podcast/. It has been working well for the duration of my podcast from 2013.

    I have been using the Powerpress plugin from the beginning without any problem. For some reason, the iTunes store isn't picking up the my last episode (#110). The stream is valid on Feed Validator, but when I check it out in iTunes Connect, the status is "Validation Failed." This explains why it does not appear in the store, but I'm confused as to what could be wrong.

    I downloaded a record fresh and added the new download link on my blog twice, but still the same error.

    Any help is appreciated.

    The exact error in iTunes Connect is, "cannot read your feed. Bad http: 500 result code ".

    Curiously, it appears for the podcast subscribers well. I'm puzzled.

  • step 2 checking does not work for me, my iPhone is not valid.

    So I get my iPhones phone number, tap Next and then it just says: enter a valid number. What is this to say that I walked into my iPhone number 10 times, he always says to enter a valid phone number.  What is the next step.

    The answer is just to keep entering the same phone number again and again until it does not say "enter the valid number."

  • What is the apple warranty valid outside the country you have earned it?

    Hi, im interested in buying a macbook pro in England, but I would like to know if the warranty is valid in other countries although it is originally from the United Kingdom

    Apple - legal hardware warranty -.

    http://www.Apple.com/legal/warranty/

  • Unlocked IPhone, SIM card is not valid problem

    Hello

    I went to study in the United States for a few months and I bought the iPhone 6s 'apple Store' to the United States.

    After that I came back to Thailand, I can't use my card SIM Thai (AIS network). It appeared that the sim card is not valid.

    I had to call apple care to solve the problem for me and after gave them my IMEI, they told me to contact verizon wireless to unlock my phone.

    So far, I confused altogether since I bought the Apple Store iphone, not Verizon.

    However, I contacted verizon wireless and even once, after gave them my IMEI, they said that since

    the unit was purchased third-party (which is apple Store) so that the device has not been locked by their network.

    I tried to restore my device so many times and also with the mode of recovery, but it still can not use.

    I checked with APPLE and they said that my device is unlocked model.

    Note that first sim that I plug when I got this device is ATT SIM card.

    I was contacted to ATT and they also said that my device has not been locked

    through their network.

    Please give me suggestions on how to solve this problem

    It seems that if you have the iPhone version, intended for use on the Verizon network. If so, it is not locked. However, this does not mean that it will work on the network in your country.  Phones, designed to run on the Verizon network use strips of LTE 13, 4 and 2. It seems that the AIS uses 3 and 1.

    https://en.Wikipedia.org/wiki/List_of_LTE_networks

    https://en.Wikipedia.org/wiki/List_of_LTE_networks_in_Asia

  • How can I check the validity of an email allegedly from apple?

    received a "Bill" for the use of cloud, but kept such a thing. Through the ' Manage/Cancel' button it asks a series of questions that slap just impersonation. How can I check if its valid please?

    I doubt very seriously that it is legitimate to Apple. Do not click on links in the e-mail or enter information in any website referenced in the email.

    The following bandages may be useful:

    Apple claim that suspicious e-mails called for iTunes are reported to the iTunes customer service:

  • I have a late 2008 aluminium MacBook El Capitan 10.11.6 running. The cam to computer with 2 GB of ram and the instructions say there is a maximum of 4 GB. This ceiling is still valid or if I add 8 GB?

    I have a late 2008 aluminium MacBook El Capitan 10.11.6 running. The computer came with 2 GB of ram and the instructions say that there is a maximum of 4 GB. This ceiling is still valid or if I add 8 GB?

    Yes, your MacBook accepts two RAM sticks of 4 GB, 8 GB total, you'd better update the firmware Version MB51.007D.B03.

    y-13-non-pro-how-to-upgrade-ram.html http://www.EveryMac.com/systems/Apple/MacBook/MacBook-unibody-FAQ/MacBook-unibod

  • Why do I get the "error: no valid source could be found" message when you try to stream video live?

    I'm trying to stream live TV and this message - "error: no valid source could be found" I am on Fox Business website and the message appears in the Fox Business Watch box at the bottom right of the page. I use a MAC with the latest OS. I have another MAC at home and I am able to access streaming content. I can also access the content using Chrome.

    Apparently the old MAC that can stream video has Flash. The new MAC Mini did not have it and I didn't because of the negative things I've heard. Unfortunately, I need on the new computer and downloaded it reluctantly. Problem solved. Thanks for your reply.

  • IMPOSSIBLE TO UPDATE ALL APS, CONTINUES TO RECEIVE YOUR COMPENSATION ACCOUNT PAL IS NO LONGER VALID, GO TO THE ITUNES STORE ETC., WHICH I DID SEVERAL TIMES GRRRRRRRRRR 50MINUTES W APPLE ADVISOR - IT HAS JUST FACT, BUT LOSE THE SETTINGS ETC. ??

    IMPOSSIBLE TO UPDATE ALL APS, CONTINUES TO RECEIVE YOUR PAY PAL ACCOUNT IS NO LONGER VALID, GO TO THE ITUNES STORE ETC, WHAT I'VE DONE SO MANY TIMES

    50MINUTES W APPLE ADVISOR - SHE HASN'T DONE, BUT LOSE SOME SETTINGS ETC. ??

    PayPal requires that a credit card account is valid.

    Payment methods, you can use in the iTunes Store, App Store and iBooks Store - Apple Support

  • My account is not valid for use in the US store?

    I m currently living in the United States but I can not buy certain items in apple store, it's always say that "your account is not valid for use in the US store" (mine is Vietnamese store). Is there anyone know how to solve this problem. Thank you

    If you are currently in the United States, then you must have a credit card US, with an address of billing in the United States, and then you can change for the US store. Without it, you wouldn't be able to change.

  • Firefox for Mac does not recognize a valid SSL certificate

    Firefox for Mac does not recognize the SSL certificate that is valid for this site, I got: https://www.georgeglazer.com. It gives a warning "not reliable." However, the Firefox for Windows does not give a warning. This happens even if I clear the cache and it happens in the Mavericks and OS of Yosemite. The certificate is up-to-date and with Comodo. Firefox for Mac is now the only browser producing these errors (v. 39, put updated) - Internet Explorer, Safari and Chrome are not. Our hosting provider has said it's probably a browser issue, perhaps having to do with intermediate certificates in Firefox being obsolete. I really hope you'll solve the problem, as it's annoying for us when we're going to do right by our customers and pay for the SSL certificate. I have attached a picture of the warning and the other from what you see on a PC: a pop-up that says it is a verified SSL certificate and gives details about the issuer, the period of validity, etc.

    COMODO should you sent a link to download the file 'bundle' containing the intermediate certificates. Who needs to go in the same directory as the certificate of your site. If you are using a control panel, your host can probably help with this process. And if you bought through them, shame on them for not taking care of this for you already!

  • Validity of the certificate of security on a Web site

    I am looking for help on the validity and security of a Web site.
    The page in question is the one that opens when you click the 'Start' button on this page:
    https://www.gov.UK/send-VAT-return

    When you press the "Start now" button a new tab opens and briefly a green padlock is seen before turning into a gray triangle with an exclamation point.

    My questions are:
    Is the site secure?
    And if that's why I make the gray triangle with the exclamation point?

    Thank you very much

    You can use the Web Console to examine more closely the problem. Here's how:

    Open the Web Console in the lower part of this tab using Ctrl + Shift + k or the menu Developer.

    Reload the page without going through the cache (Ctrl + Shift + r, or shift + click the button reload of the address bar).

    Look for the red triangles.

    As stated in the joint, the site hosting the analytical script uses the algorithm of RC4 encryption, including 36 of Firefox and later treat as unsecure. In a future version, Firefox even will not load the script, so it's something that the site should try to develop with its supplier.

  • Why Mozilla is not a certificate valid for his poll support page?

    I received the following email asking me to fill out a questionnaire:

    'Hi. '
    We work to improve the Mozilla Firefox Support Site, and we need your help. If you don't mind, please fill in this survey - it should take only a few minutes.

    http://qsurvey.Mozilla.com/S3/cfdb14/i-100600100-662734/

    Thank You! »

    When I try to go to the survey page, I get a message telling me that the security certificate is not valid. Mozilla needs to fix this.

    The link display an open HTTP link and which would not cause this problem.

    Is there a HTTP link in the email or HTTPS link?

  • Mozilla, your last update does not include the last cert of intermediaries of extended validation from Verisign, Symantec class 3 EV SSL CA - G2, please fix ASAP

    Your last update of firefox, Mozilla does not include the last cert of intermediaries of extended validation from Verisign, Symantec class 3 EV SSL CA - G2, please fix ASAP

    Firefox never includes the intermediate certificates.
    It is the responsibility of a server to include all the intermediate certificate required to make it possible to build a certificate chain that ends with a trusted root certificate embedded.

    Note that Firefox automatically records the intermediate certificates that servers send in certificates for future use Manager (they appear labelled as 'Software security device' in the References tab).
    If a server does not send a complete certificate chain then you get an untrusted error when Firefox has stored missing intermediate certificates to visit a server in the past that a send it, but you get an untrusted error if this intermediate certificate is not yet registered.

Maybe you are looking for

  • iPhone 7 Home button freezes

    While using my iPhone 7, I was in the mail. When I clicked on the home button to exit the messages, he did nothing. I continued to hit House and nothing. I also tried to turn if off and the power button was unresponsive. I waited until the screen fel

  • Does not play OGG and WebM

    I bring an OGG and WebM video directly on Firefox and it will play, but when the HTML 5 tag using video the video will not play. The tags to read the video appropriate in Safari and Chrome, thin but not in Firefox. Here is the code: <video width="960

  • The upgrade memory and HDD on Satellite Pro A300-1EA

    So, I'm new to this forum so first of all Hello to all! I plan to buy the Satellite Pro A300 1EA and I came to the conclusion that I need to buy more memory that the thing has already installed (2 048 MB).I tried to search for information through Kin

  • locked "Configuring updates stage 3 of 3 0% complete".

    More about recent updates to Vista, my laptop is blocked "Configuring updates stage 3 of 3 0% complete. I tried to restart in 'safe mode' but this doesn't seem to work. Any help please. Not too technical if you please

  • BlackBerry Smartphones Intellisync error when syncing with Bold 9930 (issues of the Organizer)

    I recently received the following error message Intellisync trying to sync my Bold 9930 with Outlook: "error occurred. Error code: 0x80043ac9. See the documentation. Someone has any idea how to solve this problem? My Organizer phone and Outlook is mo