Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Could not refresh Detail View after inserting record. No records were found ...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Could not refresh Detail View after inserting record. No records were found ...

    I have a grid with Updateable Detail view (SQL).
    Datasource is a SQL View.

    When I Insert a New Record and press Save I get this message:

    "Could not refresh Detail View after inserting record. No records were found when executing the 'Refresh row' query."

    The insertion itseld is succesful, but Alpha5 is not able to refresh the detail view.

    I guess it is related with the Identity field. It shows "0" before the record is saved, then SQL gives it a value and Alpha5 is not able to retrieve this new value.

    If I change the Datasource to a SQL Table, the problem does not happen, but I miss a lot of fields that I need and are not in the table.

    Preventing the Detail View from refreshing would be an acceptable solution, since I close the Detail View after Saving anyway.

    Thanks in advance for your help.

  • #2
    Re: Could not refresh Detail View after inserting record. No records were found ...

    same issue.
    However, having the detail view close after is not acceptable - so i need to figure out this refresh. anyone?
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

    Comment


    • #3
      Re: Could not refresh Detail View after inserting record. No records were found ...

      please can anyone help with this error ... occurring after inserting into a grid ... a big thank you in advance

      Comment


      • #4
        Re: Could not refresh Detail View after inserting record. No records were found ...

        Please can anyone help in resolving this issue ... thank you in advance ...


        Originally posted by rnoguera View Post
        I have a grid with Updateable Detail view (SQL).
        Datasource is a SQL View.

        When I Insert a New Record and press Save I get this message:

        "Could not refresh Detail View after inserting record. No records were found when executing the 'Refresh row' query."

        The insertion itseld is succesful, but Alpha5 is not able to refresh the detail view.

        I guess it is related with the Identity field. It shows "0" before the record is saved, then SQL gives it a value and Alpha5 is not able to retrieve this new value.

        If I change the Datasource to a SQL Table, the problem does not happen, but I miss a lot of fields that I need and are not in the table.

        Preventing the Detail View from refreshing would be an acceptable solution, since I close the Detail View after Saving anyway.

        Thanks in advance for your help.


        Please can anyone help in resolving this issue ... thank you in advance ...

        Comment


        • #5
          Re: Could not refresh Detail View after inserting record. No records were found ...

          I'm having the same issue with a critical data table, albeit a simple one.

          I created a SIMPLE test table. Nothing exotic. I'm closing the detail after submit. Still get the error. I get it with both AlphaADO and SQL Statements.

          I'm having it with several versions of A5, both AppServer and Developer.

          SQL Server 2008 in full 2008 mode.

          This is only happening with a SQL R/O grid with updatable detail view.

          See attached image.
          Last edited by CarlMPearson; 02-23-2011, 03:52 PM.
          Carl ~ Dallas, TX
          I'm so old that pool balls came with Roman Numerals

          Comment


          • #6
            Re: Could not refresh Detail View after inserting record. No records were found ...

            I'm not using a view, just a simple table, and still get the issue. However, I am using an Identity as the primary key, so the clue below of ID being zero until submitted looks relevant.

            If I don't use an Identity Primary Key it does not have the issue. Too bad, using an Identity PK is VERY useful in many situations. There has to be a way.
            Last edited by CarlMPearson; 02-23-2011, 03:52 PM.
            Carl ~ Dallas, TX
            I'm so old that pool balls came with Roman Numerals

            Comment


            • #7
              Re: Could not refresh Detail View after inserting record. No records were found ...

              Just came across this thread, having the issue myself. Was a solution ever found?

              Comment


              • #8
                Re: Could not refresh Detail View after inserting record. No records were found ...

                Ah, my fading memory ... I know I've seen this issue too, and gotten around it, but can't remember how. It may have been by explicitly turning off Update for the fields that did not come from the primary table.

                Comment


                • #9
                  Re: Could not refresh Detail View after inserting record. No records were found ...

                  This is usually caused by:
                  Your grid uses some sort of INNER JOIN instead of a LEFT JOIN.

                  Example
                  SELECT * FROM tbl1 INNER JOIN tbl2 ON tbl1.field=tbl2.field

                  When you insert a record - if no child record is put into table 2 - the select above will not bring back the newly added record. Hence the 'No Records found'.

                  Another reason for this is if you are not properly setting the e.lastInsertedIdentity in the OnBeforeSQLCommandExecute (this assumes you have coded your own OBSQLCE event).

                  Its mostly likely an inner join problem. Change the INNER join to a LEFT join.
                  Scott Moniz - Computer Programmer/Analyst
                  REA Inc.
                  http://reainc.net
                  (416)-533-3777
                  scott@reainc.net

                  REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
                  If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
                  contact us to discuss options.

                  Comment


                  • #10
                    Re: Could not refresh Detail View after inserting record. No records were found ...

                    For updatable grids, do NEVER, EVER use SQL Server defined Views. Use Tables instead.
                    If you need to use several tables, use the A5 SQL Query Builder to build the views inside A5.

                    Set all Ready-Only tables to Read-Only.

                    Since I do this, I never meet the problem again.

                    Comment


                    • #11
                      Re: Could not refresh Detail View after inserting record. No records were found ...

                      This is from an older post I put out there.

                      Row Refresh Problem Solved with stored procedure!

                      sql2 = "Insert into vLocationRef (Patients_ID, Facility_ID)
                      (:Patients_ID, :Facility_ID)"
                      flag = e.cn.execute(sql2,args)
                      If flag = .t. then
                      e.flagError = .f.
                      e.errorText = ""
                      e.rowsAffected = e.cn.affectedRows()
                      e.SQLToDisplay = sql2
                      e.ArgsToDisplay = ""
                      Sql2 = "exec dbo.spGetLocationRef_ID :Patients_ID, :UserIdAdd"
                      flag = e.cn.Execute(sql2,args)
                      if flag then
                      rs = e.cn.ResultSet
                      e.lastInsertedIdentityValue = rs.data(1)
                      e.rv.V.R1.LOCATIONREF_ID = e.lastInsertedIdentityValue
                      End If
                      else
                      e.flagError = .t.
                      e.errorText = e.cn.callresult.text
                      e.rowsAffected = 0
                      end if

                      Comment


                      • #12
                        Re: Could not refresh Detail View after inserting record. No records were found ...

                        You didnt have to use a stored procedure.
                        You are using a workaround/hackish method to get the grid to work.
                        The grid should work by itself and if it doesn't then something else is wrong.

                        E.g the inner/left join I said before.
                        Basically this error occurs like this:

                        You add data to your grid.
                        You or the grid run insert code.
                        The grid tries to refresh the data for the row by using hte grids SQL statement - it appends a WHERE clause using the e.lastInsertedIdentityValue.
                        If the above statement does not find records - this error will be produced.

                        Examples:
                        Grid statement SELECT * FROM client INNER JOIN client_information ON client.client_id=client_information.client_id
                        Grid: Allows for insertion of client but does not insert any corresponding record into client_information
                        Add data and hit Save - The error will be produced.

                        Example:
                        Client table
                        cliID 1 First Name: Joe Last Name: Bob

                        Client Information
                        No corresponding records

                        After insert lets say we add Jane Doe.
                        The statement will be:

                        SELECT * FROM client INNER JOIN client_information ON client.client_Id=client_information.client_id WHERE client.client_id=2 <<This statement will not return a record because the client information does not contain a corresponding record for client ID 2 and then INNER join will omit the records because of this.

                        The solution:
                        Grid statement SELECT * FROM client LEFT JOIN client_information ON client.client_id=client_information.client_id

                        This will return the client records even if there are no client_information records.

                        Another Problem:
                        In your grid events: make sure the e.lastInsertedIdentityValue is being set to e.cn.CallResult.lastInsertedIdentity (you may have to look these up - i forgot the exact name of these).


                        These are the 2 major problems that result in this record (from my experience): I have trouble shooted this error many many times and it 95% one of the above 2 problems.
                        Scott Moniz - Computer Programmer/Analyst
                        REA Inc.
                        http://reainc.net
                        (416)-533-3777
                        scott@reainc.net

                        REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
                        If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
                        contact us to discuss options.

                        Comment


                        • #13
                          Re: Could not refresh Detail View after inserting record. No records were found ...

                          Also, you can use a view with multiple tables, however, on the view, you need to code the instead of trigger. The stored procedure will bring back the last identity and load it into e.lastInsertedIdentityValue. I wouldn't consider this a workaround. This view has all left joins. Some views are just more complex than others.

                          Comment


                          • #14
                            Re: Could not refresh Detail View after inserting record. No records were found ...

                            I had the same problem. If fixed it in "Grid > Query > Select Primary Key". Select the primary key (if you haven't already) and check the "Primary Key is auto-increment?" checkbox (if your id is auto-increment like mine).

                            Comment


                            • #15
                              Re: Could not refresh Detail View after inserting record. No records were found ...

                              The problem seem to be that you had populate a computed column in the select statement, and at the field property in grid it was set to updateable.

                              In my case, I just remove this computed field.
                              I changed the logic, instead of using a select expression, I used a client expression in a grid property.
                              and it worked fine

                              Comment

                              Working...
                              X