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

No Brainer (Me or the Question?)

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

    No Brainer (Me or the Question?)

    Should be simple enough.

    On a form I have 2 calculators to help the user determine discounts & markups.

    Works sometimes when adding a record but not always or when changing.

    Re-Calc button calls for a "REFRESH" (Action Script). Help indicates this DOES NOT work in change or edit mode. Unfortunately the help fails to say what will work!

    Simply, the re-calc button should force the form calculated fields to re-calc & display.

    I never cease to be amazed at how the simpleset things screw up the works.

    Thanks , John

    #2
    Re: No Brainer (Me or the Question?)

    Hi John,
    Help indicates this DOES NOT work in change or edit mode.
    To place in "view" mode use a topparent.commit(). You could even check the mode first to eliminate the overhead of committing when not necessary.

    Something like:

    Code:
    if tbl.mode_get()= 1 .OR. tbl.mode_get()= 2 then      'in change or enter mode
       topparent.commit()  'places in view mode
    end if
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: No Brainer (Me or the Question?)

      What do the field objects shown on your form represent? A mixture of table fields and variables? What are the calculations done? Are they tied to events such as ondepart for the fields?
      There can be only one.

      Comment


        #4
        Re: No Brainer (Me or the Question?)

        Stan

        Calculator 1:

        Standard Cost: Calculated (Field Rules) Reg. Cost - Disc %) .
        Trial Markup: Variable - user enter
        Trial List: Form calculated field: Std. Cost x Trial Markup.
        Margin: Form calculated field: Trail List - Std. Cost.

        Example:

        Std. Cost: 50.00
        Enter Trial Markup: 1.5
        Trial List: 75.00
        Margin: 25.00

        The idea is that the user may repetitively try different "Trial Markups" (Calc 1)
        or different Trial Discounts (Calc 2) until satisfied with the numbers.
        Calc 2 the same but different.

        Not tied to any events (what, you think I know what I'm doing?)

        Thanks, John

        Comment


          #5
          Re: No Brainer (Me or the Question?)

          John,

          You might try using variables only on the form, with the button's OnPush event with the code. Then a save button to write the vars to a table (if that is what you want) when the user has the results they are looking for.
          Peter
          AlphaBase Solutions, LLC

          [email protected]
          https://www.alphabasesolutions.com


          Comment


            #6
            Re: No Brainer (Me or the Question?)

            Peter

            Sounds like a lot of work. Stan's question about on depart twigs the question, is there a command that could be placed in the on depart event , that would simply force the calc fields to re-calc.

            Sorry to seem so dense (always use A5 defaults & action scripting)

            Contrary to popular opinion, Laziness not necessity is the mother of invention.
            My story & I'm sticking to it.

            Thanks, John

            Comment


              #7
              Re: No Brainer (Me or the Question?)

              If memory serves, form level calculated fields should recalculate when any of the values involved in their expression definintion change. The only time you should need a commit and a refresh or resynch is if you are changing table level fields form representation. IOW, changing the value in a form object without saving the record does not change the table field value and thus calculations based on them do not re-calc.
              There can be only one.

              Comment


                #8
                Re: No Brainer (Me or the Question?)

                Stan

                Getting closer. By your definition the form calculated fields will not re-calculate when an "ENTER Trial Markup" is inputted, because it is a variable.

                Would putting the "correct" command (refresh, resync....?) in the on depart event of this field force a re-calc.

                Thanks, John

                Comment


                  #9
                  Re: No Brainer (Me or the Question?)

                  Originally posted by John Gamble View Post

                  Would putting the "correct" command (refresh, resync....?) in the on depart event of this field force a re-calc.
                  A refresh() or resynch() command will not force a calc update as far as I know. Those commands update underlying data tied to a form.

                  But try the following in your OnDepart event:
                  Code:
                  tbl = table.current()
                  
                  tbl.recalc_calcFields()
                  Peter
                  AlphaBase Solutions, LLC

                  [email protected]
                  https://www.alphabasesolutions.com


                  Comment


                    #10
                    Re: No Brainer (Me or the Question?)

                    I tried to recreate the first scenario and my form displays the trial list and trial margin changes immediately upon exiting the trial markup variable field. I did make my expressions for the form calculated fields a bit different.

                    Standard_Cost: Calculated (Field Rules) Reg. Cost - Disc %) .
                    Trial_Markup: Variable - user enter
                    Trial List: Form calculated field: Standard_Cost x var->Trial_Markup.
                    Margin: Form calculated field: calc->Trial List - Standard_Cost
                    There can be only one.

                    Comment


                      #11
                      Re: No Brainer (Me or the Question?)

                      Peter

                      Worked but takes 10 seconds to calc. Seems ridiculous as there are only 20 form calc field in total (3 of which are lookups).

                      Sounds like we are on the right track.

                      Will try to fiqure out how to place only the required calc's in the on depart event.

                      Thanks, John

                      Comment


                        #12
                        Re: No Brainer (Me or the Question?)

                        Originally posted by John Gamble View Post
                        Worked but takes 10 seconds to calc. Seems ridiculous as there are only 20 form calc field in total (3 of which are lookups).
                        tbl.recalc_calcFields() recalculates the table level calculated fields for every record in the table.
                        There can be only one.

                        Comment


                          #13
                          Re: No Brainer (Me or the Question?)

                          Originally posted by Stan Mathews View Post
                          tbl.recalc_calcFields() recalculates the table level calculated fields for every record in the table.
                          Ouch!
                          Peter
                          AlphaBase Solutions, LLC

                          [email protected]
                          https://www.alphabasesolutions.com


                          Comment


                            #14
                            Re: No Brainer (Me or the Question?)

                            Peter, Stan, Mike

                            By moving only the required calcs to the on depart event,

                            WORKS, Instantly:D.

                            Thank you all.

                            Aside

                            A5 is again creating duplicate form calc fields, some the same, some different.

                            Deleting them does not work. They just pop up again.

                            ????????

                            Thanks mucho, John

                            Comment


                              #15
                              Re: No Brainer (Me or the Question?)

                              Originally posted by John Gamble View Post
                              Contrary to popular opinion, Laziness not necessity is the mother of invention.
                              Hey..hey..execuse me but that's my saying!

                              I ain't talking no more cause am hopping mad now!
                              And why do you even have to do any of that when there is a more sofisticated less time consuming approach?
                              But I ain't talking..

                              Comment

                              Working...
                              X