Add WHERE criterias in addition to what the user enters on search page

Hi,
This may be a simple problem, but I have not been able to solve it.....Is there a way for me to code another search criteria in addition to what the user enters?
I'm trying to create a simple search page. Basically, user logs on, i get his acoount number and save it in a variable. Then whatever the user's search criterias are , I want to add "AND ACCOUNT = ???."
I've tried:
In the processRequest, retrieve his account number using a VO, stored account number in variavle x and then call a initQuery(x) for the VO to get only the rows that he should be able to see. Problem A: I get 'SQLStmtException' when I test the page by trying to do a Simple Search. So to fix that, in the VOImpl, I added these two calls -- setWhereClauseParams(null); setWhereClause(null); -- after the executeQuery(). After I did this, ran into Problem B: the user could search any record that wasn't associated with his account.
I also tried to dynamically create the vo using createViewObjectFromQueryStmt("Select * from table where account = " + x) but was not successful. The page didn't render and I received a ClassCastException similar to this thread -- Re: How to Create OAViewObject programatically
I'm new to OAF and would appreciate any pointers on how to implement this.
Thanks,
LL

Hi,
I assume that you haven't tried the following steps..if you have and still get an error, give us the SQL statement error that is coming up. If I misunderstood your requirement, could you elaborate.
I assume that when the user logs in you get the account number automatically.
You could define the VO to have the following where condition 'WHERE ACCOUNT=:1'.
Then you set the account id from the user using setWhereClauseParams(0,accountid) and call executeQuery. This would limit the result to that user.
This will work in addition to any other search fields that might have been used in the query.
For e.g with just the account id the sql that will be fired is
Select attribute1, attribute2....from Tablexxx where account = :1
Any other user search criteria given in the page will result in a ssql query like the following
select * from (Select attribute1, attribute2 ...from Tablexx where accoount = :1) where newattribute like `%xx`
Hope this helps. Let us know if you still have issues.
Thank you,
Arun

Similar Messages

  • Generating a PDF of what the user sees, and sending it as a binary stream to the server

    Hi All,
    On the final page of our Flex app, we allow the user to print out a copy of everything they've entered for their own records.
    I'm wondering if there is a way for me, programmatically, to generate a PDF document that is the same as their printout (I pass a particular container to the "print" button I've got for the user), and send those bytes back to the server.  We can store this PDF along with all the rest of their data, and it would be useful as a "snapshot" of exactly what the user saw when they submitted their application.
    I'm looking into Flex PDF generation, but so far haven't gotten this figured out.  I thought some folks here might be able to point me in the right direction.
    Thanks!
      -Josh

    Here is how you can take a snapshot.
    import mx.graphics.ImageSnapshot;
    import mx.graphics.codec.IImageEncoder;
    import mx.graphics.codec.PNGEncoder;
    import mx.utils.Base64Encoder;
    private function uploadImage(rSource:IBitmapDrawable):void
                        var tBitmapData:BitmapData = ImageSnapshot.captureBitmapData(rSource);
                        var tEnc:IImageEncoder = new PNGEncoder();
                        var tBA:ByteArray = tEnc.encode(tBitmapData);
                        var tB64:Base64Encoder = new Base64Encoder();
                        tB64.encodeBytes(tBA);
                        // send tB64.toString() using POST to the server to save the image.
    // call
    uploadImage(this) // where parameter is an object to get the snapshot of. Can be anything including Application. ("this" in my case).

  • How to add a field to the selection screen and when the user enters ...

    hi all,
    can any one plesase send the code of how to add a field to seletiion screen and when the user enters in the field , it should be store in the database table , the table is MKPF and the field is BKTXT.  Thanks.

    Hi Kripa,
       If u r using PNP ldb then the screen u will get is the screen for that ldb and if u want to add some more fields then u define using selection-screen..as follows
    SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE text-111.
    PARAMETERS: n_in_en  RADIOBUTTON GROUP g1,
                q_ev  RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK mysel.
    SELECTION-SCREEN BEGIN OF BLOCK mysel1 WITH FRAME TITLE text-222.
    PARAMETERS: r_date TYPE sy-datum DEFAULT sy-datum.
    SELECTION-SCREEN END OF BLOCK mysel1.
    SELECTION-SCREEN BEGIN OF BLOCK mysel2 WITH FRAME TITLE text-333.
    PARAMETERS:f_ver(3) TYPE c DEFAULT 1,
               c_no(10) TYPE c DEFAULT '9D0161',
               u_id(15) TYPE c,
               password(15) TYPE c,
               r_email(30) TYPE c DEFAULT PARAMETERS: s_not TYPE c AS CHECKBOX.
    PARAMETERS:t_run TYPE c  AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK mysel2.
    SELECTION-SCREEN BEGIN OF BLOCK mysel3 WITH FRAME TITLE text-444.
    SELECTION-SCREEN BEGIN OF BLOCK mysel4 WITH FRAME TITLE text-555.
    PARAMETERS: p_ser  RADIOBUTTON GROUP g2,
    a_ser  RADIOBUTTON GROUP g2.
    SELECTION-SCREEN END OF BLOCK mysel4.
    SELECTION-SCREEN BEGIN OF BLOCK mysel5 WITH FRAME TITLE text-666.
    PARAMETERS:p_path TYPE string.
    SELECTION-SCREEN END OF BLOCK mysel5.
    SELECTION-SCREEN END OF BLOCK mysel3.
    u will get this additional screen after the screen of ldb.
    I hope this will help u..
    Thanks & Regards
    Ashu Singh.

  • Add code behind functionality that run when the user view the SP 2013 content pages

    I need to add code behind functionality that run when the user view the SP 2013 content pages, What is the best approach to do that?
    is it add Delegate Control to master page?
    is it add code behind to master page?
    is there an event reviver for that?
    Your answer will be highly appreciated

    Hi,
    According to me, for code behind stuff
    Create master page(using module etc..), have the required placeholders in it.
    Then, create a page that inherit from this master page, now you can use that placeholder in you page.
    Lastly, place web parts in that placeholder. So, code behind will come with that master page .
    Hope it helps.
    Thanks
    -Rahul

  • How to add Column field in the custom Query Link search page as a header

    Hi,
    I have created a Query page link in web layout editor. Now, I want to customise the view of the result. I see an option to change the "Text1" and "text2", but how do I add other fields as a colum in the search result ?
    The only column I see by default Id, Title, release date and author. I want to see some of the custom metadata in the search result. I don't wan't to apply user specific custom search page.
    Overall, I want a common search view across all the user such that each user doesn't have to create a custom search view.
    Please help.
    Thanks

    hi
    By adding context node, you will not be able to fetch value. To fetch value in BTSubject, you need to have following nodes in your context node.
    Node          Relation                  Higher level node
    BTAdminH
    BTBOSSet  BTHeaderBOSSet   BTAdminH
    BTSubjectSet BTSubjectSet_A BTBOSSet
    BTSubject BTSubjectAll  BTSubjectSet_A
    Right now you dont have BTBOSSet and BTSubjectSet in your view. That is why component is unable to pull data in BTSubject.
    My suggestion would be to create cuco with above nodes
    Bind BTAdminH with BTAdminH of Component controller
    and bind BTSubject of details view with BTSubject of your Cuco.
    If you want code code gp catalog as it comes in complaint then there is seperate procedure for that.
    Best regards
    Pankaj Kumar

  • AT SELECTION-SCREEN ON VALUE-REQUEST  - what has the user entered so far?

    Hi,
    the online help says to
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_xyz.
    With the events for the field and input help, no data is transported between the selection screen and the ABAP program
    p_xyz is indeed empty at this event, but is there really no way to find out what the user had entered so far?

    Did you try a call to FM DYNP_VALUES_READ (Check at [Input Help in Dialog Modules|http://help.sap.com/SAPhelp_nw70/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/frameset.htm])
    Regards,
    Raymond

  • Prompt the error message according to what the user had entered.

                   for(int i = 0; i<3; i++){     
                        do{                              
                             try{
                                  System.out.print("Input range for Question " +(i+1) +": ");     
                                  inputQuestionRange = Integer.parseInt(input.nextLine());
                             }     catch(NumberFormatException e){
                                       System.out.println("Error: Please enter a valid number.");
                                  if(inputQuestionRange > 5 || inputQuestionRange <2){
                                       System.out.println("Error: Please Range enter between 2 to 5.\n");
                        }     while(inputQuestionRange > 5 || inputQuestionRange <2);     
                             question[i] = new int[inputQuestionRange];
                   }//for rangeResult:
    Input range for Question 1: 2d
    Error: Please enter a valid number.
    Error: Please Range enter between 2 to 5.
    Input range for Question 1:
    I would like to prompt the error message according to what the user had input.
    However when user input *2d* it just print both error message as it went into the if-else block. how can i skip the if-else block ???

                   //Set Range
                   for(int i = 0; i<3; i++){     
                        do{                              
                             try{
                                  System.out.print("Input range for Question " +(i+1) +": ");     
                                  inputQuestionRange = Integer.parseInt(input.nextLine());
                                       if(inputQuestionRange > 5 || inputQuestionRange <2){
                                            System.out.println("Error: Please Range enter between 2 to 5.\n");
                                       }     else{
                                                 System.out.println("OK");
                             }     catch(NumberFormatException e){
                                       System.out.println("Error: Please enter a valid number.");
                        }     while(inputQuestionRange > 5 || inputQuestionRange <2);     
                             question[i] = new int[inputQuestionRange];                    
                   }//for rangeResult:
    Input range for Question *1*: 22
    Error: Please Range enter between 2 to 5.
    Input range for Question *1*: d
    Error: Please enter a valid number.
    Input range for Question *1*: 3
    OK
    Input range for Question *2*: ww
    Error: Please enter a valid number.
    Input range for Question *3*:
    Hi, thank you for your help, i just realize another problem.
    why does my Question number increment to 3, it should remain as 2 when i request for user input again. i try many ways by altering the for loop, when i insert the try & catch block in a while(!invalid), it just loop forever and crash. How can i solve this ?
    Edited by: metaroot on Feb 18, 2008 1:55 PM

  • What's an easy way to determine what the user typed is a date object?

    What's an easy way to determine what the user typed is a date
    object?
    Thanks!

    Thanks for trying. Sorry for not being clear. but I figured
    it out.
    the user can type in a date, or a name to search. The format
    they type in date has to be in mm/dd/yyyy.
    I was able to use:
    if (new Date(textEntered).toString()=="Invalid Date") {
    // not a date entered
    else {
    // a date is entered
    To do what I need to do.
    Thanks.

  • How do you redirect the user to a custom page after the "Save" button is clicked?

    In SharePoint 2010, I could add the following code to a save button to redirect the user to a custom page.
    <input type="button" value="Submit" class="btnStyle" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={/SitePages/Thankyou.aspx}')}" />
    However, how do you do this for a save button in SharePoint Online? The code of a save button in SharePoint Online looks like
    <input type="button" value="Save" name="ctl00$ctl33$g_175de2e0_43c1_4005_bac5_0ab02439686f$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem" onclick="if (!PreSaveItem()) return false;if (SPClientForms.ClientFormManager.SubmitClientForm('WPQ1')) return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ctl33$g_175de2e0_43c1_4005_bac5_0ab02439686f$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true;javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={/SitePages/Thankyou.aspx}')}))" id="ctl00_ctl33_g_175de2e0_43c1_4005_bac5_0ab02439686f_ctl00_toolBarTbl_RightRptControls_ctl00_ctl00_diidIOSaveItem" accesskey="O" class="ms-ButtonHeightWidth" target="_self">

    Not exactly what you are asking for, but if you are creating the link then you could add "?Source=" to the URL.
    http://yourServer/sites/yourSite/Lists/TestList/NewForm.aspx?Source=/SitePages/Thankyou.aspx
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • Reg: Configuring the User-Defined Message Search

    Hi Experts !
    I am getting an error while configuring the user defined message search.
    Followed all the step mentioned in the sap help documentation.
    http://help.sap.com/saphelp_nwpi711/helpdata/en/48/c85598f63335bfe10000000a42189d/frameset.htm
    The last step, where we need to enter  URL for WSDL Access i am getting the following error:
    Error in WSDL access: Exception occurred in communication framework:
    Error in HTTP Framework:404Not Found
    http://<Host>/<Port>/MessageSearch/MessageSearchImplBean
    You should enter the host name and the HTTP port for the Advanced Adapter Engine
    i didnt get the meaning of above sentence : Is it different from what we use in the URL to access ESR and ID.
    Is there any other steps to make   MessageSearch/MessageSearchImplBean available
    Regards,
    Srinivas
    Edited by: Srinivas on Oct 1, 2010 7:48 PM

    Hi José Omar,
    thanks for the reply...
    I tried manual configuration but with no luck..opened a similar forum thread
    I have applied the sap note suggested  ,thinking that the error is due
    to any source code.
    The data synchronization is happening properly , but when i use test extractor button it throws the above mentioned error.
    In the system details  in have given the port number as 50700(which is visible in the link when we open integration builder page) and ESR client as 001.
    could you please let me know if the exact values to be filled in transport setting.i just entered the port and client , other things
    as default.
    Regards,
    Srinivas

  • How do I create a form field ONLY template in Acrobat 9 Pro that will let the user enter and print only the form field data on a pre-printed form?

    This template will be used to type in information that will then be printed on an agency's official, barcoded form loaded in a printer (instead of blank paper.)  Only the user-entered info should print on the pre-printed form.  Users will use Adobe Reader to complete their templates; they do not have Acrobat.  Thank you!

    Use the template as non-printable background and add the form fields.

  • How to get the User entered value in the Submit request form for a parameter of a concurrent program in Oracle applications.

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

  • How to keep a calculation field blank until the user enters a number?

    I am building a sales sheet for a school that sells scrip as a fund-raiser. I have the document set so that when the user enters the number of scrip certificates he wants (say, two $25 gift certificates at Lowe's), the program will automatically calculate that this user owes $50 for that scrip category. However, there are more than 100 companies that one can choose from, and if the user doesn't enter a number, the calculated field shows $0. Is there a way that each field can stay blank until the user enters a number bigger than zero? By the way, I'm using this calculation to determine the value (borrowed from a user on this forum): event.value = 50 * this.getField("Lowes").value
    Thanks!

    There are two approaches. You can either add the following Validate script:
    // Custom Validate script for calculated field
    if (+event.value !== 0) event.value = "";
    Or you can change your custom Calculate script and set the Format type of the field to "None":
    // Custom Calculate script
    (function () {
        var v = +getField("Lowes").value;
        event.value = (v !== 0) ? util.printf("$%.2f", v) : "";

  • After upgrading 3.6.7, in "google image search" all the results appears in one page, I just need to go back to the previous way of search : page after page.......??

    After upgrading 3.6.7, in "google image search" all the results appears in one page, I just need to go back to the previous way of search : page after page.......??
    where can I adjust this option ?? I tried in IE, the search way is normal as in past..
    == This happened ==
    Every time Firefox opened

    I believe this to be a browser issue, not a google search results issue, and here is why:
    having updated Firefox only yesterday, I visited google images searching for pancakes.... interestingly, I have the NEW image results (yuck) on Firefox 3.6.8, I have the OLD image results on IE8 and Opera 10.53.
    When I use the 'switch to basic version' in Firefox 3.6.8, indeed it DOES revert to the new format next time I image search (in Firefox).
    For those of us who prefer the OLD image results page, I guess we will just have to switch browsers for google image search.
    Now I'm off to research how to get rid of the UGLY FFox sidebar.

  • How to find the user entered value is Integer or not?

    hi,
    i want to find, whether the user entered value is Integer or not. If it is Integer, i wanna continue the program. otherwise send an error message. i tried to find for function in API. But i couldn't. can somebody help me with sample code. very urgent.

    Do a Integer.parseInt(<string value>) in a try catch block If a NumberFormatException is thrown, the entered number is not an integer.

Maybe you are looking for