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

Ajax Callback error

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

    Ajax Callback error

    I use a pretty basic ajax callback and every few times I call this function I get this error error


    HTML Code:
    Fatal error running a5_ajax_grid(): Result set row requested not found while getting result set data column 'progress_bar'. on line 14 in 1000793:pl
    Now, I have completely removed the progress_bar field from my grid and it will just replace that with something else.

    It's really frustrating that it happens in the first place but what I truly don't understand is that it happens inconsistently, I have found no pattern and am ready to loose my mind.

    If anyone at all can help with this I have spent the past 2 months trying to figure out why this is happening and can't get an answer.

    Here is my ajax callback:

    Code:
    function Rejected as c (e as p)
    	
    dim cn as sql::Connection
    dim args as sql::arguments
    dim sql as c = ""
    
    sql = <<%a%
    update client_list
    set status = 1, status_by = :By, status_when= :Date
    where Client_List_ID = :ID
    %a%
    
    cn.open("::name::CompanyProfile")
    cn.PortableSQLEnabled = .t.
    args.add("ID", e._currentRowKeys[1])
    args.add("By", session.current_first_name + " " + session.current_last_name)
    args.add("Date", date())
    
    cn.Execute(sql, args)
    cn.FreeResult()
    cn.close()
    Here is the only error I can find in firebug when it happens:

    Screen Shot 2013-01-18 at 9.21.16 PM.png

    Thanks so much for any help!! I really really need it!

    #2
    Re: Ajax Callback error

    Would it help to clear the args? I don't know how long or through which operations arg data is kept but it would seem like a good idea to clear them if the callback is used multiple times.

    Comment


      #3
      Re: Ajax Callback error

      Lily - You're using session variables in your args. Is it possible the session is expiring and that leads to the error occuring?

      Comment


        #4
        Re: Ajax Callback error

        Lily, try doing this.

        1) Place debug(1) in the callback to make sure it works every time.

        2) If you can't figure it out, then simplify your callback:
        Code:
        function Rejected as c (e as p)
          'your lines will go in here
        
          'always the last line of callback
          Rejected = "alert('Callback has completed');"
        end function
        3) Gradually add back in chunks of your function until it breaks.

        Comment


          #5
          Re: Ajax Callback error

          Hey everyone, thank you soooo much for giving me advice!! :-)

          Jinx - that sounds link a good idea, do you know how to clear args?

          Jeff - the session variables are related to the user who is logged in, so the update is happening for the client but I don't require any session variables from that client to produce the results.

          Andy - The callback works every time despite the error. I will try now to start from scratch with the callback.

          :-)

          Comment


            #6
            Re: Ajax Callback error

            http://wiki.alphasoftware.com/SQL+Arguments+Object

            Comment


              #7
              Re: Ajax Callback error

              Jinx, thank you. I did try implementing your suggestion and was pretty hopefully that it would work but no luck.

              Soooo I started stripping everything out and have found out it is related to my detail view... I don't know why or how or how to fix it but for some reason my detail view is not happy with the callback.

              Any suggestions? I really wanted to use this layout.

              Thanks! :-)

              Comment


                #8
                Re: Ajax Callback error

                Are you sure that you have placed a debug(1) at the end of the callback and confirmed that the SQL statement has executed correctly every time?
                Why don't you return an alert('completed'); statement as a confirmation that the callback executed correctly.
                Note that you currently do not return a js string, and there is no error checking in your xBasic.

                Comment


                  #9
                  Re: Ajax Callback error

                  Hi Andy,

                  I made a video here in hopes to clarify: http://screencast.com/t/t8kX2dKxxs

                  Thanks soooo so much for your help!

                  function Rejected as c (e as p)
                  dim cn as sql::Connection
                  dim args as sql::arguments
                  dim sql as c = ""

                  sql = <<%a%
                  update client_list
                  set status = 1
                  where Client_List_ID = :ID
                  %a%

                  cn.open("::name::CompanyProfile")
                  cn.PortableSQLEnabled = .t.
                  args.add("ID", 16)

                  cn.Execute(sql, args)
                  debug(1)
                  args.clear()
                  cn.FreeResult()
                  cn.close()

                  Rejected = "alert('completed');"
                  end function

                  Comment


                    #10
                    Re: Ajax Callback error

                    Check on how to debug...
                    video 66: http://news.alphasoftware.com/v11preview/videos_v11.htm
                    http://www.youtube.com/watch?v=6nSnmjUdU4M

                    You will want to test the result of your query to see if it was successful:
                    dim result as L
                    result = cn.Execute(sql, args)

                    You will want to step through the lines in the debugger, and check the value of "result".


                    EDIT...of course, none of this matters if it is the act of making the callback itself causing the problem. Could you confirm whether an empty callback as I had originally posted gives problems?
                    Last edited by agillbb; 02-04-2013, 01:29 PM.

                    Comment


                      #11
                      Re: Ajax Callback error

                      This doesn't appear to be related to the callback but rather the grid itself. Are there any filters defined in the sql or any conditions in the grid that are somehow related the the table being updated?
                      Creating Healthcare Work-Flow Solutions Since 2005

                      Comment


                        #12
                        Re: Ajax Callback error

                        Hi Omar,

                        Yes, I agree it with you, the ajax callback is working properly. The grid itself does have to filters Admin_ID = :admin_id AND status = 2

                        That should be it... I will remove them and see if that makes any difference.

                        Do you have any other suggestions?

                        Thanks so much!

                        Comment


                          #13
                          Re: Ajax Callback error

                          Omar!!! You're a genius! How is this the problem? I don't understand? Is it because of 2 filters?

                          What do you think?

                          I need both filters so I don't know how I can do it without them.

                          THANK YOU THANK YOU THANK YOU!

                          Comment


                            #14
                            Re: Ajax Callback error

                            I PROMISE YOU... This has helped me so much and my stress so much! I put the filter down to 1 instead of 2 and used a base filter when opening the grid and so far so good.

                            I'm beyond excited and completely grateful for your suggestion!!!!!!!!!!!!!!!!!! Thank you!!!!!!!!!!!!!!!!!!!!!!

                            Comment


                              #15
                              Re: Ajax Callback error

                              When you update the record, the grid is still looking for the record. You may want to return: Rejected = "{grid.Object}.refresh();alert('completed');"
                              Creating Healthcare Work-Flow Solutions Since 2005

                              Comment

                              Working...
                              X