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

Action Scripting "Save Record" anomaly?

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

    Action Scripting "Save Record" anomaly?

    I have a query about the "Save Record" action script. It doesn't allow me to specify a save at the child record level, only the parent record level. Whereas the "delete record" action script does allow for deletions at either the parent or child level.
    I am working on a form that has a set defined with two 1-to-many browses imbedded in the form. I want to provide a button for each of the two child browses so that a user can save only the correct new child record. But because of this problem I can only save at the parent level. No problem with providing two delete buttons because the delete action script allows me to specify the correct child record to delete.
    I am not averse to writing XBasic code to do the child deletion but I cannot find any relevant XBasic construct that will do this either.
    Does anyone have experience with this problem and knows of a way to get round this?

    #2
    RE: Action Scripting

    Bret, as I understand it, when you have a child table in an embedded browse:

    as soon as you move up or down the browse, or depart the browse, the record is saved.

    I may not correctly understand what you want, but you cannot have two records in an embedded browse in a change mode, at the same time, thus deciding which one you wanted to "save."

    However, if there are two records in the browse you can just hightlight the row, and do a Ctrl-D, which will delete the record you don't want. Or maybe make a button next to the browse deleting the currently focused child record.

    Beyond this, I go to field rules for the child table, and and add code in record events for the "cansaverecord" event. But I don't think that is really necesaary in this case.

    If there additional factors please post back
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      RE: Action Scripting

      Brett,

      Can't one of your 'Save Child Record' scripts do something like this:

      1) get pointer to the child table;
      2) check it's mode;
      3) commit the change or enter if one is pending.

      Data entry through browses is tough to control (at least for me). Even if the user doesn't push your 'Save child Record' button, the pending changes will be saved to the child table if the user shifts focus outside the browse, or changes rows within the browse. Sometimes this isn't desirable.

      -- tom

      Comment


        #4
        RE: Action Scripting

        I had resigned myself to some adept coding to do what I want here. Thanks for the helpful suggestions.

        Comment


          #5
          RE: Action Scripting

          I have a similar situation, but I have 2 buttons that control the child browse.... one to allow edits and one to save the record..
          What I don't know (at this time) is how my 'solution' will react to just changing 'focus'..
          I will (over the next 2-3 days) get into this and let you know what I find...
          Should be interesting and educational (at least for me)
          D

          Comment


            #6
            RE: Action Scripting

            Thanks, Richard. I will be interested to hear the outcome.

            Comment


              #7
              RE: Action Scripting

              Sorry for the delay, but here now...
              Description:
              Modal form
              Restrict: enter, change, delete thru properties
              Normal frame
              Parent buttons: quit, save parent, cancel changes, enter new record, change parent record
              **note - some buttons were placed on form before making restrictions, and not taken off yet..
              Child buttons: change item, save item
              _______________________________________________________
              Obviously, the new rec and delete (ctl-d) do not work on the parent record. Change parent, save parent, and cancel changes all work for parent. Change parent allows changes on the child record also.
              Change child allows changes for child but not for parent.
              Save child works fine.
              ctl-d works for deleting child records...
              Change child also allows new child record if press enter from last field in current record.

              Changing focus from the child record (in progress) does save that incomplete record...

              I am not sure what this all means (at this stage anyway) but it does raise some pertinent questions about what might need to be done to 'eliminate or prevent' accidental record corruption or erasure.....

              If you come up with any earth shattering ideas, please keep me posted either here or at
              [email protected]

              thanx
              D

              Comment


                #8
                RE: Action Scripting

                I am confused!
                Back to basics. At a 1 to many set level when you save a child record it does not save a new parent record, although if you view the default browse for the set this does appear to be the case but each composite record contains only a copy of the Parent.

                If you really want an "Orphan" child the only way to enter this would be to use a from or browse at the table level leaving the linking field blank.

                Or am I missing something

                Comment


                  #9
                  RE: Action Scripting

                  Hello, Colin. Thanks for your interest. I am certainly not trying to create orphans here, far from it. My application makes it mandatory for all child table entries to have a parent. But I noticed a problem here during my testing.
                  I have a form in which there are imbedded two scroll boxes representing records in a set which has two 1 to many relations from the master to each of two child tables. The linking field from the master is the same to both child tables. I noticed in testing that in some circumstances (and I am uncertain exactly what these are) if I enter a new record into one scroll box on my form and then jump to the second, changes in child tables where not always being saved. So it occurred to me to use the "save record" action script and specify the child table record I wanted to save by way of a "save" button beneath each scroll box. This I had already done successfully with two "delete" buttons. Clearly it is important for the "delete record" action script to allow me to select which of the two child records should be deleted but there is apparently not so pressing a need for the "save record" dialog script to be able to select the correct child table. There is just no capability for "save record" as there is with "delete record" to select the correct child table. IMHO this is an oversight on the behalf of A5 Software that should be corrected.
                  I have a temporary (I hope) work around that appears to resolve the problem I currently have. I have two "save" buttons beneath each of the scroll boxes that both do absolutely nothing useful ! The act of clicking on each one seems to provide the trigger for A5 to save the child record simply through the shift of focus that occurs from the new record to the button. So, as I say, problem circumvented for the moment but I feel by skullduggery and not by science!

                  Comment


                    #10
                    RE: Action Scripting

                    Thanks, Richard. I did have some ideas on how to work round the problem and also how to solve it permanently - see my reply to Colin Roberts below.

                    Comment


                      #11
                      RE: Action Scripting

                      Bret, when you change rows within an embedded browse, and/or when you depart the browse, I assure you - the record will be saved.

                      Unless - in field rules there are rules in place that are preventing the record from saving, or code in your form somewhere, either in the browse of the form.

                      open the default form for the set. see if you can repeat the behavior of the record not saving. if you cannot, then the problem is in your form. if you can, then the problem is in the form and/or the set. like a complex linking field
                      Cole Custom Programming - Terrell, Texas
                      972 524 8714
                      [email protected]

                      ____________________
                      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                      Comment


                        #12
                        RE: Action Scripting

                        meant to say:

                        if you can, then the problem is in the field ruels and/or the set. like a complex linking field
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        [email protected]

                        ____________________
                        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                        Comment

                        Working...
                        X