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

Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

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

  • Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

    A field A has its value derived from a URL result WHEN you OnPush a Btn.
    Value fills in successfully.
    The VERY NEXT Field , A2 is a Field Rules Calc'd Field (The Wonder idea) BASED on the New Value in Field A by way of a Lookup Into a tbl that is properly indexed
    Ex:
    Field A value = "FREEMAN" derived from a Url.
    Field A2 is a Clc Field Rule Lookup into tableXY where it's Field X = "FREEMAN" and it's corresponding FIELD Y = "025" which is what Field A2 should fill as.
    IOW:
    Fld A2 Field Rule = LOOKUP("TableXY","FIELD X='"+ALLTRIM(FIELD A)+"'","FIELD Y")
    PROBLEM:
    THE FIELD RULE CALC GOES COMATOSE IF the value in FIELD A is derived from anything other than a Manual entry or a Form lookup Pick List or a simple default expression OnArrival
    However when you SAVE the changed record, Voila! it fills in FIELD A2.
    Is there a way to make FIELD A2's new lookup value appear immediately before a record save occurs, when the FIELD A is derived from a source external to A5?
    Caveat:
    The Retrieval from a URL is via a Button next to the FLD A.
    IOW, it is not auto- or default-calc'd from the URL. You have to push the Btn.
    5hrs work on work-arounds (refresh BS etc.)
    Learning A5, So far, for me, basically requires suspending all human activity short of bodily functions.
    Last edited by SMARTII; 08-15-2010, 05:18 PM.
    First Love

  • #2
    Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

    Hi Tom,

    Have you looked at the Events from field A? Perhaps OnDepart? Or OnChange?

    Right mouse click on the field and select Events.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


    • #3
      Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

      THE FIELD RULE CALC GOES COMATOSE ...
      Interesting way to put that, really. Almost all field rules are designed to work only when data entry is occurring through the keyboard, not when field values are being changed by scripts.

      As for a solution why not have the script that fills the first field, compute and populate the second? i.e. instead of using the calc field rule

      Comment


      • #4
        Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

        Table Calculated fields are supposed to update regardless, I'm pretty sure.

        However, that said, I agree with Tom, that I would use a script instead of a calculated field here - and here's the reason: with calculated fields like this, I have been quite successful in getting them to work reliably in a particular build of a particular version - but new versions and new builds will often break them.
        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


        • #5
          Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

          ..all field rules are designed to work only when data entry is occurring through the keyboard...
          Is even more interesting! Another A4 Battle scar.
          re:
          have the script that fills the first field, compute and populate the second..
          OK, I did this;
          Append the URL script with:
          parentform:A2.VALUE = LOOKUP("TABLEXY","X='"+A.VALUE+"'","FIELD Y")

          Now I have to find a replacement for getting it when the URL fails...It has to be a precise, exact field value from the lookup into that table again..
          On arrive:
          Tried:
          a xbasic script ie a simple lookup as above and fills screen with errors.
          Need work-around again.
          One work-around begets another, like fly eggs.
          Of course the cure for all this would be able to do a FORM clc'd table field on the FORM.
          I Understand folks think that's heresy, but it is a false fear as 24yrs of programming just that way proves.

          Thanks Tom and all.

          Appears to work (around).
          Nice if we had a Work-around Folder with all words indexed.
          As soon as you hit a wall, then goto the index to see who hit the same wall & got thru it.


          Originally posted by Tom Cone Jr View Post
          Interesting way to put that, really. Almost all field rules are designed to work only when data entry is occurring through the keyboard, not when field values are being changed by scripts.

          As for a solution why not have the script that fills the first field, compute and populate the second? i.e. instead of using the calc field rule
          First Love

          Comment


          • #6
            Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

            Originally posted by Keith Hubert View Post
            Hi Tom,

            Have you looked at the Events from field A? Perhaps OnDepart? Or OnChange?

            Right mouse click on the field and select Events.
            I tried this Keith.
            I think I tried everthing in events but putting my Apache Headdress on and doing the smoke pipe fire dance.

            I CAN'T GET A LOOKUP() TO WORK IN AN EVENT!!!!!!!!!
            Apparently it does this eval thingy and then explodes in errors.
            Then threw out the action script idea & tried xbasic..whole new set of crap errors, or null returns.
            Now 8hr in.
            First Love

            Comment


            • #7
              Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

              If you have logmein or similar, send me an invite - I bet we can figure it out.
              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


              • #8
                Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

                Tom

                As Keith has suggested you could use the onDepart or canDepart event of A field with your code. I would suggest CanDepart event so that when field A is filled in it would run the code and fill in field A2

                Code:
                parentform:A2.VALUE = LOOKUP("TABLEXY","X='"+s_quote(parentform:A.VALUE)+"'","FIELD Y")
                however, you would have to change the field rules for the A2 field to "user entered" from calculated.

                FWIW

                Tom Baker
                Last edited by Tbaker; 08-15-2010, 08:45 PM.

                Comment


                • #9
                  Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

                  Tom_M,

                  the original problem is not that the calc field rule fails to fire, it's that the rule fails to fire when you need it to fire. You mention that it correctly behaves once you "save" the record. The difficulty we have is that we have little control over when and how these field rule scripts & expressions are run. In many apps this makes no difference. In yours it's obviously important to you. So, a solution outside of field rules is most likely going to be your best approach.

                  Comment


                  • #10
                    Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

                    Thanks Tom, It worked.
                    Then I put the FIELD A2 in Read Only so they can't doodle with the value.

                    Originally posted by Tbaker View Post
                    Tom

                    As Keith has suggested you could use the onDepart or canDepart event of A field with your code. I would suggest CanDepart event so that when field A is filled in it would run the code and fill in field A2

                    Code:
                    parentform:A2.VALUE = LOOKUP("TABLEXY","X='"+s_quote(parentform:A.VALUE)+"'","FIELD Y")
                    however, you would have to change the field rules for the A2 field to "user entered" from calculated.

                    FWIW

                    Tom Baker
                    First Love

                    Comment


                    • #11
                      Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

                      Tom,
                      Thanks.
                      I runs even deeper:
                      1. The Orig value of FIELD A is IMPORTED from an external source.
                      2. If FIELD A2 is no longer Calc'd, then
                      You have to fill in FIELD A2 via a Lookup() since the external file has no FIELD A2 values.
                      3. If I don't do this then the user could skip the FIELD A & FIELD A2 and save a record that has no FIELD A2 value!
                      At the same time you don't want them needlessly going in&out of FIELD A just to get a FIELD A2 value. This form has 36 fields as it is. They don't need more work.
                      4. I have 5 different Import Formats, so 5 other import Scripts have to be changed.
                      5. The url is only needed to correct an erroneous FIELD A about 15% of the time.

                      In general we call this Cascading Consequences Level 4.
                      And Why? Because calculated Tbl Field at the Form Level is ...Heresy against the Church of Alpha, or the db progamming Monastery.
                      Originally posted by Tom Cone Jr View Post
                      Tom_M,

                      the original problem is not that the calc field rule fails to fire, it's that the rule fails to fire when you need it to fire. You mention that it correctly behaves once you "save" the record. The difficulty we have is that we have little control over when and how these field rule scripts & expressions are run. In many apps this makes no difference. In yours it's obviously important to you. So, a solution outside of field rules is most likely going to be your best approach.
                      Last edited by SMARTII; 08-15-2010, 09:35 PM.
                      First Love

                      Comment


                      • #12
                        Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

                        Tom, I'm glad you've got it working. I don't fully understand your last comment, but I fear I've misled you a bit. The calc field rule works. It just isn't working when you need it. If your data entry were occurring (in field 1) through the keyboard you'd see the calc field behave almost instantly. It's helpful however, to remember that many other field rules won't be enforced at all if the field values in your record are being changed by a script instead of the user sitting at the keyboard.

                        Comment


                        • #13
                          Re: Change of Fld Val from outside Source Negates Value Change in Clc'd Fld

                          Thanks Tom,
                          It's just the hrs spent "finding out" and then storing it in the Brain for the future.
                          RE:
                          "The calc field rule works. It just isn't working when you need it."
                          I just didn't expect A5 field rules to work like certain parts of my body!


                          Originally posted by Tom Cone Jr View Post
                          Tom, I'm glad you've got it working. I don't fully understand your last comment, but I fear I've misled you a bit. The calc field rule works. It just isn't working when you need it. If your data entry were occurring (in field 1) through the keyboard you'd see the calc field behave almost instantly. It's helpful however, to remember that many other field rules won't be enforced at all if the field values in your record are being changed by a script instead of the user sitting at the keyboard.
                          First Love

                          Comment

                          Working...
                          X