Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

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

Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

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

    Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

    Hi...

    I am getting the error 'Error - Could not refresh row. Query for primary key '[primary key]' returned no data.' when I save in my list. Now I know why I am getting the error message, but I don't want it to error just to save and then refresh the list.

    Basically my list is running off a query with a Where clause that only pulls records of a certain status (LIVE and IDLE). When I change the record to be a status that the query is not pulling (CANCELLED or CONFIRMED) it obviously then removes the record from the list (which is what I want it to do). So the code is then attempting to find it again so it can select it in the list. Hence the error. What I need it to do is remove the record from the list and refresh the grid selecting the next record in the row. How do I do this?

    Many Thanks
    Gina

    #2
    Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

    Hi Gina, welcome to the forum.

    Could we get a bit more info?

    Version/Build of Alpha you're using?
    Is your List Data Source SQL Server? MySQL? DBF? Something else?
    Is your List Data Source actually a Query? Or are you using Arguments and a WHERE clause in the List Data Source? Or just a WHERE clause, or Filter in the List Data Source?
    Can you post the Query you're using?
    You're updating the List via a List Detail View?
    How are you refreshing the List?
    Last edited by Davidk; 03-09-2018, 12:26 PM.

    Comment


      #3
      Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

      Hi David,

      Thank you. Right answers to your questions...

      Version/Build of Alpha you're using?

      Version 12.4.5.2, Build 4770

      Is your List Data Source SQL Server? MySQL? DBF? Something else?

      Sql Server 2008

      Is your List Data Source actually a Query?

      Yep Query off a view
      Or are you using Arguments and a WHERE clause in the List Data Source? Or just a WHERE clause, or Filter in the List Data Source?

      The view filters the statuses
      Alpha filters for user name and customer code

      Can you post the Query you're using?

      Code:
      SELECT cu_code, customer_name, cust_order_no, web_order_head_id, oh_order, oh_call_off, invoice_account, amend_date, amend_time, amend_user, create_date, create_time, create_user, for_collection, delivery_date, preferred_day, master_status_id, login_name, status_description, ro_delivery_date_month_name, ro_delivery_date_iso_week, ro_delivery_date_day 
      FROM v_web_current_orders 
      WHERE login_name = :USER_NAME  AND  cu_code = :CU_CODE  
      ORDER BY amend_date DESC, amend_time DESC
      You're updating the List via a List Detail View?

      Changing via code (a button in the list calls the function below), but there is a list detail view associated to this list too

      Code:
      function ChangeOrderStatus(newStatus){
      
      	//Find if we have the data already in our basket
      	var listOHeads = {dialog.object}.getControl('LIST_ORDER_HEADERS');
      	
      if({dialog.object}.argumentValue('DEBUG')== 1){debugger;	}
      			
      	//define optional settings
      	var ops = {};
      	ops.setFocusToTargetRow = true;
      
      	if (listOHeads)
      	{
      
      		//Go get our primary key			
      		var id = {dialog.object}.getValue('LIST_ORDER_HEADERS');
      
      		var data;
      		data = listOHeads.getData(id);
      	
      		//did we find our primary key?
      		if (data){
      	
      			updData = {};
      		
      			//Update the record
      			//alert('found primary key');
      			updData.master_status_id = newStatus;
      			listOHeads.updateTableRow(id,updData,ops);
      			
      			//save the changes
      			{dialog.object}.saveListEdits('LIST_ORDER_HEADERS',{rows: 'current'});
      		}
      	}
      
      }
      How are you refreshing the List?

      The saveListEdits funtion seems to be refreshing it. There is no explicit code refreshing it.

      Many thanks in advance for any help you can give.
      Gina

      Comment


        #4
        Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

        You can save, navigate to next, then refresh?

        Comment


          #5
          Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

          Hmm this is my second attempt at posting...


          Version/Build of Alpha you're using?

          Version 12.4.5.2, build 4770

          Is your List Data Source SQL Server? MySQL? DBF? Something else?

          SQL server 2008

          Is your List Data Source actually a Query? Or are you using Arguments and a WHERE clause in the List Data Source? Or just a WHERE clause, or Filter in the List Data Source?

          The list source is a query off a view. The view filters the statuses and the where clause on the source filters by user_code and customer_code

          Can you post the Query you're using?

          Code:
          SELECT cust_code, customer_name, master_status_id, login_name, status_description
          FROM v_web_current_orders 
          WHERE login_name = :USER_NAME  AND  cust_code = :CU_CODE  
          ORDER BY amend_date DESC, amend_time DESC
          You're updating the List via a List Detail View?

          The list is being amended through code...

          Code:
          function ChangeOrderStatus(newStatus){
          
          	//Find if we have the order alread
          	var listOHeads = {dialog.object}.getControl('LIST_ORDER');
          				
          	//define optional settings
          	var ops = {};
          	ops.setFocusToTargetRow = true;
          
          	if (listOHeads)
          	{
          
          		//Go get our primary key			
          		var id = {dialog.object}.getValue('LIST_ORDER');
          
          		var data;
          		data = listOHeads.getData(id);
          	
          		//did we find our primary key?
          		if (data){
          	
          			updData = {};
          		
          			//Update the record
          			//alert('found primary key');
          			updData.master_status_id = newStatus;
          			listOHeads.updateTableRow(id,updData,ops);
          			
          			//save the changes
          			{dialog.object}.saveListEdits('LIST_ORDER',{rows: 'current'});
          		}
          	}
          
          }
          How are you refreshing the List?
          It seems that the saveListEdits function is doing the refresh. The code doesn't do an explicit refresh.

          Many thanks in advance
          Gina

          Comment


            #6
            Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

            I have posted a reply (twice) your question DavidK, but I have been told that it is going through the moderator. So now I wait. Argh.

            dbinns - thank you for your response, but no the problem occurs during the save function. Sorry.

            Comment


              #7
              Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

              I do not think the rest of us ever see a message from the bulletin board that our posts have to go through a moderator.
              It sounds like you are new to the forum. I wonder if there is a confirmation step you have to go through to complete the registration for this forum. Like perhaps clicking a link in an automated email from this board. Or, maybe going to the "Notifications" section of this board from the menu item that is at the very top of this page and clicking or replying to some message that is in there.

              Comment


                #8
                Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

                I'd be happy to look at it if you can share it or an example?

                Comment


                  #9
                  Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

                  Originally posted by RichCPT View Post
                  I do not think the rest of us ever see a message from the bulletin board that our posts have to go through a moderator.
                  It sounds like you are new to the forum. I wonder if there is a confirmation step you have to go through to complete the registration for this forum. Like perhaps clicking a link in an automated email from this board. Or, maybe going to the "Notifications" section of this board from the menu item that is at the very top of this page and clicking or replying to some message that is in there.
                  Rich

                  New users are filtered out until a moderator approves them.

                  Too many spammers to trust an open forum.

                  There is a cool tool to permanently banish a user and report them to the spam police.

                  Spammers tend to go in streaks. Lots one day, none for a while.

                  Must be the Russians...
                  Al Buchholz
                  Bookwood Systems, LTD
                  Weekly QReportBuilder Webinars Thursday 1 pm CST

                  Occam's Razor - KISS
                  Normalize till it hurts - De-normalize till it works.
                  Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                  When we triage a problem it is much easier to read sample systems than to read a mind.
                  "Make it as simple as possible, but not simpler."
                  Albert Einstein

                  http://www.iadn.com/images/media/iadn_member.png

                  Comment


                    #10
                    Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

                    Gina,

                    Is it possible that you're trying to update a SQL View that cannot be updated... at least from Alpha? Can you post the View?

                    Comment


                      #11
                      Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

                      Gina,
                      We might want to clarify if this is a Grid or a UX.
                      I had similar situation in Grid where a record should, theoretically be eliminated from the user's view after changing the status of a record from active to inactive. What I did was to place a search part filter on the grid that includes the status field as a checkbox control with "Active" and "Inactive". It defaults to just having "Active" check-marked. In the Grid I added a status (image) column that shows a blank image for "Active" or a red-stop sign for "Inactive". (This is a client-side conditional image.) When Alpha refreshes a row where a record has changed from "Active" to "Inactive", the row still l appears but it has an ugly red stop sign. If the whole list is refreshed, the row disappears. So, you may also want to look at the list refresh options after refreshing a single row. There might be an option to refresh entire list if your users frequently change status to your "inactive" value. Or, if that action is less common you just show the row, but with a status icon that makes it obvious that row / record is inactive.

                      Comment


                        #12
                        Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

                        Reading the posted information, Gina is using a List Control... therefore a UX.

                        Comment


                          #13
                          Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

                          Gina,
                          In your update code, "ops.setFocusToTargetRow = true"

                          should be

                          "ops.setFocusToTargetRow = false"

                          When your target row/record no longer has status of "live" or "idle". Although, I don't see that piece in your query, anyway that is supposed to suppress records that are not of those two values. I am just going off what I read from your first post.

                          Comment


                            #14
                            Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

                            Hi David,

                            The update works if I pick a status that is not being filtered out by the view. The problem occurs because when the status is changed to cancelled it is the filtered out from the view and the refresh in Alpha then attempts to find the row in the list using the primary key and it complains that it doesn't exist. Which it doesn't and it shouldn't. What I need to find a way to do is to get the list to refresh, but not try to find the row it updated (the saveListEdits function automatically does the refresh). I am hoping it is a tick box that says 'do not locate current record', but that is probably asking too much.

                            Hi Rich,

                            I am using a list control in a UX. I did contemplate loading all the orders into the list and then filtering on the list itself. However there could potentially be millions of records (I know I could use batches) and I really want to only pull the records that are relevant as the users bandwidth will be limited. This might be the only option I have as I can't see how else I can get round this. I have looked at the list refresh options, but can't find anything that looks like it might help. I tried "ops.setFocusToTargetRow = false" and still got the error. :(

                            Many thanks
                            Gina

                            Comment


                              #15
                              Re: Error - Could not refresh row. Query for primary key '[primary key]' returned no data.

                              That is too bad the "ops.setFocusToTargetRow" did not work. I have only one LIST in my system that uses updateTableRow() directly and that list does not allow deletes. I was just hopeful that would be the solution.

                              I wouldn't be too surprised if the method is not honoring or using that parameter.

                              Maybe that function could be traced through in the debugger to see why that parameter does not work.

                              Comment

                              Working...
                              X