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

Saving list detail records

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

    Saving list detail records

    Can someone give me a sure fire way to save and synchronize a list detail record all at the same time? The save and synchronize functions are two distinct things, but most of the time I want the save and sync to happen at the same time. There is no reason most of the time for the processes to be different.

    But when I try to combine the scripts into a single function, I often run into what looks like timing errors. Sometimes the sync happens too quickly (or the save happens too slowly) and it doesn't actually happen. You go back to the list, and despite the fact that you have run the sync code, you still have a little mark in the corner of the record. Doing a manual sync then fixes the issue.

    But I want to eliminate any need for a manual sync.

    Has anyone else run into an issue like this?

    #2
    Re: Saving list detail records

    I can't remember running into an issue like this. The save edits is all client-side and happens fast. Could be you're doing something to hold things up.

    However, use A5.runChain to ensure the sync happens only after the save.

    Code:
    function saveEdits(obj) {
    	var lObj = {dialog.object}.getControl('LISTCUST');
    	lObj.updateListFromUXControls();
    	obj.next();
    }
    
    function syncList(obj) {
    	{dialog.object}.saveListEdits('LISTCUST',{rows: 'allRows'});
    	obj.next();
    }
    
    //create an array with the functions to executed
    var actions = [saveEdits,syncList];
    
    //run the actions synchronously
    A5.runChain(actions,
        function() { alert('alldone'); },
        function(err) { alert('error: ' + err); }
    );
    https://www.alphasoftware.com/docume...n%20Method.xml

    Comment


      #3
      Re: Saving list detail records

      you can set the list to sync policy in the list to do a client to server sync everytime you save an edit (you only need to save).

      Due to my apps being offline at times I do have a sync button that is hidden unless there are unsync'd records so someone offline can go back and force a sync without creating a record to do so.

      Comment


        #4
        Re: Saving list detail records

        David,
        I think the saveListEdits is going to return control to javascript immediately after submitting the request to the server, unless there is some way you can tell that function (with its AJAX call) to sit and wait for the server's response.

        ALL,
        If the user sync's edits from the LIST to the server immediately after each row and if the syncs are run asynchronously through AJAX will it be safe or okay to possibly have the server trying to process these requests concurrently?

        Maybe I am making this too complicated, but in my updateable LIST I put up "Please wait..." message that locks the screen when the LIST is being sync'd to the server. On the server-side 'afterAjaxCallback' event I have code that checks for the Persist Data event and inserts JavaScript into the response to clear the "Please wait..." message. The "Please wait..." message also has a timeout of 30 seconds, to hide itself and display an error message if a response is not received from server in that amount of time. For the record here is what that code looks like:

        Code:
        function afterAjaxCallback as v (e as p)[INDENT]'Fires after the Ajax callback has completed. You code can modify the response sent to the client.
        'Variables in the 'e' object include:
        'e.tmpl - definition of the UX component	
        'e.ajaxResponse - the response that will be sent to the client.
        
        'e.action = Ajax callback action type
        'e.callbackFunctionName = Ajax callback specific action
        
        if e.action = "GenericAjaxCallback" .AND. e.callbackFunctionName = "system:persistListData"
        	'-- Clear the please wait message after saving list data
        	e.ajaxResponse = "CP_HidePleaseWait();" + crlf() + e.ajaxResponse
        end if[/INDENT]
        
        end function

        Comment


          #5
          Re: Saving list detail records

          I have checked that box before. I'm not sure it does what it says it does reliably.

          Comment


            #6
            Re: Saving list detail records

            Rich... maybe I've misread Larry's post but I didn't think waiting for the server return was his issue... he can clarify. He didn't mention where the "corner indicator" was or what colour it was, but he mentioned possible timing issues between save and sync. We also don't know what's going on during a save... what else he's got firing.

            Comment


              #7
              Re: Saving list detail records

              For me, the problem primarily happens when you use the list delete function to delete a record from the list. Just a general save works but deleting a record seems to require a separate sync, no matter what the settings are.

              Comment


                #8
                Re: Saving list detail records

                Larry in my limited experience it works well. I am new to this but I've had an 4 instances of an application running using this method for 90 days 24/7 and I've seen no issues.

                I am not deleting records however. You may need to add a sync event to the delete record button?

                Comment


                  #9
                  Re: Saving list detail records

                  So it's not an edit, save, sync... but rather a delete, save, sync that is causing the issue? That's very specific info.

                  Comment


                    #10
                    Re: Saving list detail records

                    I can't seem to duplicate a save, sync issue, but I definitely have a delete, sync issue.

                    I am trying to come up with a sample I can post for you to test.

                    I am having trouble wrapping the predefined functions that save and sync lists into either the runchain or the executethisthenthat javascript functions to see if I can get it to work that way.

                    I keep getting javascript errors.

                    Comment


                      #11
                      Re: Saving list detail records

                      I think I "solved" the issue.

                      When you delete records in a list, you still have to save the records before the delete will actually take place. (similar to how a grid works.)

                      I wasn't doing the save step, just the delete step.

                      If you delete, then save, it works fine so far as I can tell.

                      Comment

                      Working...
                      X