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

Setting Field values

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

    Setting Field values

    I frequently have situations where I need to set/update values for fields that don't physically appear on either a form or browse screen and which can not be suitably set using default values or calculations established as part of the table filed rules. Based on my limited Alpha experience, it seems that unless a field appears on the form or the browse screen there is no simple way to affect its value apart from the field rules. I thought that I could use an Action Scripted event to accomplish this via the Set Field Value action, but Alpha won't permit the selection of a field control as the object of the event unless it pysically exists on the form or browse screen. Help?

    A simple Example:
    I might have a table containing a field that is used to indicate where the source entry of the data was made. This field would be set or updated with one value if the entry is made in Form/Browse A, and a different value if the entry is made in Form/Browse B. This a field that I don't want the end user to see or have any interaction with so it would not be placed on the form or the browse screen. How can I affect the value of this field in this circumstance?

    #2
    Re: Setting Field values

    Originally posted by DRW View Post
    This a field that I don't want the end user to see or have any interaction with so it would not be placed on the form or the browse screen.
    Being on the form and being visible are separate matters. You can get and set the values of field objects on a form whether they are visible or not. You can set the values of the underlying table fields without their being on the form.
    There can be only one.

    Comment


      #3
      Re: Setting Field values

      Stan thanks for your response.

      I am aware that being on a form and the visibility of a control when placed on the form are two separate issues and that field values can be manipulated for either.

      "You can set the values of the underlying table fields without their being on the form."

      This is precisely where I am missing the magical connection. I'll try to clarify. Say I have a simple table with fields: CustID, RefDoc, Date, Amount, and Source. When records are entered by means of a Browse, I want to explicitly set the value of Source dependent upon which Browse is used to enter the record, without Source needing to be planted in the browse view. If the record entry originates from a Browse called SalesOrder, I want to set Source as 'SO', and if the record originates from a form called CounterSales I want to set the value as 'CS'. If Source isn't put into the Browse display as a column then how do I control setting its value since it won't appear on the list of available controls from which to pick for defining Set Field Value browse event?

      Comment


        #4
        Re: Setting Field values

        Add the field to the form/browse and then set the hide property on.
        Al Buchholz
        Bookwood Systems, LTD
        Weekly QReportBuilder Webinars Thursday 1 pm CST

        Occam's Razor - KISS
        Normalize till it hurts - De-normalize till it works.
        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
        When we triage a problem it is much easier to read sample systems than to read a mind.
        "Make it as simple as possible, but not simpler."
        Albert Einstein

        http://www.iadn.com/images/media/iadn_member.png

        Comment


          #5
          Re: Setting Field values

          Ok, placing a field control on a form and setting it to hidden in order to be a ble to then have the ability explicitly control its value outside of the actual data entry process strikes me a as a somewhat inelegant and convoluted. I suppose for many 'Form' situations it would workable. But how does one make a browse column hidden? There is no Column property setting that I can find that adresses 'hidden'. So I try to define a Browse event on the simple Browse I previously described using Action Scripting to hide a field control (column). It doesn't seem to work. I pick 'Hide Object' as the action and then try to pick a specific object (in this case field) to be added to the list of hidden objects. But Alpha shows no objects that can be selected to be added to the list. I checked the help file and it suggests that 'hide object' action should work with a browse. I can't get it to.

          Comment


            #6
            Re: Setting Field values

            Douglas, another solution involves a bit of xbasic script. How do your users save a record? Do you require them to push a button? Is it possible for the browse and the form to both be open at the same time?

            -- tom

            Comment


              #7
              Re: Setting Field values

              Originally posted by DRW View Post
              But how does one make a browse column hidden?
              Edit the width of the column. Make it .0001 or so. Won't be hidden but will be difficult to see.
              There can be only one.

              Comment


                #8
                Re: Setting Field values

                Originally posted by Stan Mathews View Post
                Edit the width of the column. Make it .0001 or so. Won't be hidden but will be difficult to see.
                Oops about the hidden property of the browse field. Another option is to grab the right side of the column title and drag it to the left side.

                I think you can set the width to zero.

                I've done via the object explorer...
                Al Buchholz
                Bookwood Systems, LTD
                Weekly QReportBuilder Webinars Thursday 1 pm CST

                Occam's Razor - KISS
                Normalize till it hurts - De-normalize till it works.
                Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                When we triage a problem it is much easier to read sample systems than to read a mind.
                "Make it as simple as possible, but not simpler."
                Albert Einstein

                http://www.iadn.com/images/media/iadn_member.png

                Comment


                  #9
                  Re: Setting Field values

                  Douglas,
                  I'm wondering if this is what you had in mind. The example has 2 forms and a browse. The code is in the Field Rule Record event OnSaveRecord. When the user saves the record, it updates the field:Source in the Main table with the name of the object where the entry was made and also places an entry into the Audit table.

                  Hope this helps
                  Mike W
                  __________________________
                  "I rebel in at least small things to express to the world that I have not completely surrendered"

                  Comment


                    #10
                    Re: Setting Field values

                    Mike, thanks so much for posting your example. Its very close to what I have in mind and provides me with some ideas of how to approach my problem using xbasic.

                    My immediate need was/is to effect field value updates much like your examples, except the data entry operations would be performed totally within either an embedded browse or named browse without the use buttons to invoke either the create or save operations. In other words the user would strictly be adding records in a browse/tabular format and the Source field would get updated upon simply saving a row by moving to another or new record row or exiting the browse and saving the changes.

                    I played around a bit with trying to get Browse events to accomplish the objective with mixed results. Alpha demonstrates some interesting peculiarities with how it deals with Browse events. I'm scratching my head still trying to deduce the logic of how/why Alpha produces the odd results that I encounter. Figure if I beat my head against the wall long enough the light bulb will come on. But I'm kind of thinking that I will ultmately need to resort to xbasic code much along lines of your examples in order to correctly and consistently accomplish my needs.

                    I have one caveat regarding your examples with respect to the persistency of events coded as table field rules. Doesn't that approach mean then that the event(s) will always be triggered all instances whenever the table is acted upon in a create or change mode? I would not want this to be the case as I can envision circumstances where data modifications might need to be made to records without regard to the values contained in the Source field - in which case I wouldn't want the event updates to be invoked and risk unintended alterations to the Source field. So, I am presuming that the event programming would instead need to be attached to directly to the specific form or browse wherein I want those event updates to occur.

                    Comment


                      #11
                      Re: Setting Field values

                      Douglas, I think you're looking at the situation correctly. The CanSave event for the browse object in your form would be a good "hook" to tie your script to.

                      Comment

                      Working...
                      X