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

Help on scripting or whatever?

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

    Help on scripting or whatever?

    Could someone suggest or show me after I have tried for hours and haven't gotten anywhere but frustrated...

    I have a field labled assignnum and a field labled assignto...

    What I am attempting to do is if assignnum is = to CAT001 or between CAT500 it will automatically fill in the field assignto in the same record Catering...

    I have several different dept. like CON001-CON500 that I would like to have automatically fill in the field same record with assignto = Concession...

    It would be one added entry that would have to be done and a lot of saved time... Surely there is a way... I tried several scripts to no avail...

    Thanks to anyone who might help me with this...

    #2
    Re: Help on scripting or whatever?

    Processes in Alpha don't care what the associated field label might be. You address them by their object names (revealed by examining their object properties - right click on the object). Understanding this we move on to the concept of events.

    Things such as you describe happen in response to events.

    What I am attempting to do is if assignnum is = to CAT001 or between CAT500 it will automatically fill in the field assignto in the same record Catering...
    This sounds like that what you want is when the form field object representing the assignmnnum is changed (onchange event), you want the value in the form object representing assignto to be set to some value. I'm not clear what whether "Catering" represents a value or another form field object.

    If "Catering" is a value then the onchange event code for the form field object representing the assignnnum field might be


    if between(assignnum.value,"CAT001","CAT500")
    assignto.value = "Catering"
    else
    'other choices here
    end if

    If "Catering" is another form field object (whose object name is also Catering) then the onchange event code for the form field object representing the assignnnum field might be

    if between(assignnum.value,"CAT001","CAT500")
    assignto.value = Catering.value
    else
    'other choices here
    end if
    There can be only one.

    Comment


      #3
      Re: Help on scripting or whatever?

      I must be doing something wrong... I have tried everything... I have inserted the following code:
      ----------------------------------------------------------
      if between("assignnum.value","CAT001","CAT500")
      Assignto.value="Catering"
      else
      end if
      if between("Assignnum.value","CON001","CON500")
      Assignto.value="Concessions"
      end if
      ------------------------------------------------------------
      and I have put in the event script and Oninit etc... It doesn't do anything at all... I check the syntax and it passes so I am at a loss...
      Do I need to set anything in the Field rules or unset anything...
      Thanks...

      Comment


        #4
        Re: Help on scripting or whatever?

        Keller,

        You have
        Code:
        if between("assignnum.value","CAT001","CAT500")
        Assignto.value="Catering"
        else
        end if
        if between("Assignnum.value","CON001","CON500")
        Assignto.value="Concessions"
        end if
        Did you also try what Stan gave you as possibilities??
        Such as NO doublequotes around Assignnum.value ?? Such as
        Code:
        if between(assignnum.value,"CAT001","CAT500")
         Assignto.value="Catering"
         else
         end if
         if between(Assignnum.value,"CON001","CON500")
         Assignto.value="Concessions"
         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


          #5
          Re: Help on scripting or whatever?

          I finally got it to sort of work...
          -------------------------------------------------
          if between( Assignnum.value,"CAT001","CAT500")
          Dept.value = "Catering"
          else if between( Assignnum.value,"CON001","CON500")
          Dept.value = "Concessions"
          end if
          -------------------------------------------------

          The problem I have now is when I enter the value of example CAT250 the value in the field "Dept" will not show the Catering value until I save then take the cursor and click on that field... Only then will it pop in... Really strange... I tried to use the code in every pop up editor "OnRowChange", "OnSave", "Events", etc... Nothing seems to let it fill in the field value upon enter or save... Any ideas?
          Thanks...

          Comment


            #6
            Re: Help on scripting or whatever?

            Keller,
            It sounds as if you are using a browse and that what you are seeing is it not resynching or being refreshed which it will do when clicked on as you found out. You can place this code right after your current script ....
            parentform.commit()
            parentform.resynch()

            OR

            parentform.commit()
            parentform.refresh_layout()

            OR

            parentform.commit
            parentform:YOUR_BROWSE_NAME.refresh()


            .Repaint() is another possibility.
            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


              #7
              Re: Help on scripting or whatever?

              I really appreciate it!!! Is their not a way to have a real time entry? Yes I am in browse mode... I wish I could upon entering the value and moving to the next field that it would automatically do its thing and not have to wait until you save the browse.entry...
              Thanks...

              Comment


                #8
                Re: Help on scripting or whatever?

                The OnRowChange event can be used. Place the commit and refresh there if for some reason the browse is having an issue with showing a new value entered....there might be something else going on as well.

                Time for me though to get some much needed sleep....1 am again here---just cannot seem to break away from this lately.
                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


                  #9
                  Re: Help on scripting or whatever?

                  Originally posted by kellerm View Post
                  I finally got it to sort of work...
                  -------------------------------------------------
                  if between( Assignnum.value,"CAT001","CAT500")
                  Dept.value = "Catering"
                  else if between( Assignnum.value,"CON001","CON500")
                  Dept.value = "Concessions"
                  end if
                  -------------------------------------------------

                  The problem I have now is when I enter the value of example CAT250 the value in the field "Dept" will not show the Catering value until I save then take the cursor and click on that field... Only then will it pop in... Really strange... I tried to use the code in every pop up editor "OnRowChange", "OnSave", "Events", etc... Nothing seems to let it fill in the field value upon enter or save... Any ideas?
                  Thanks...
                  Keller

                  What event is executing this code?

                  Sounds to me like it should be an onchange for the field in the browse. You would need to have a function in the events that is named something like <mycolumnobjectname>_onchange().

                  Fomr A5v9 - help - What's new in version 8 - Browse improvements - Browse events - New Browse Events.
                  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


                    #10
                    Re: Help on scripting or whatever?

                    Thanks Al...
                    Here is whats happening now!

                    ----------------------------------------------
                    if between( Assignnum.value,"CAT001","CAT500")
                    Dept.value = "Catering"
                    else if between( Assignnum.value,"CON001","CON500")
                    Dept.value = "Concessions"
                    end if
                    mycolumnDept_onchange()

                    FUNCTION S_N_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION PROPERTY_NUMBER_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Repaced_w_S_N_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Assignnum_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Sort__TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION DEPT_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Condition_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Assigned_To_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Status_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION DATELOST_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Make_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Model___TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Equip_Type_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION CAMP_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION FEE_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION

                    FUNCTION Last_Update_TitleClick AS V ( )
                    'DESCRIPTION: If the browse click behavior is set to call a user defined event, this method is called when the title row of the browse is clicked.


                    END FUNCTION
                    ---------------------------------------------------

                    I didn't put any of the above in red... It showed up on its own somehow!
                    Anyway I tried your thought in every event possible and it still doesn't want to change as I enter the correct value... I either have the wrong place in events or obviously I am just not able to figure this one out...

                    Many Thanks on your help... All of you thanks!!!

                    Comment


                      #11
                      Re: Help on scripting or whatever?

                      Code:
                       
                      FUNCTION Assignnum_onchange AS V ( )
                      if between( Assignnum.value,"CAT001","CAT500")
                      Dept.value = "Catering"
                      else if between( Assignnum.value,"CON001","CON500")
                      Dept.value = "Concessions"
                      end if
                      END FUNCTION
                      This should work if the object name is Assignnum.

                      You want the dept to change when the assignnum changes, yes?

                      Add this code to the events - events scripts
                      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


                        #12
                        Re: Help on scripting or whatever?

                        AL!!!!!!!
                        YOU ARE THE BEST!!!! IT WORKS!!!!
                        Certainly I don't want to take away from the others who tried so please know how much I appreciate you guys...

                        Al,
                        One last question? Should the same script work on forms the same way? If so I tried it and it doesn't perform the same way... I placed it in the events and made sure the object name was the same...

                        Thanks again...

                        Comment


                          #13
                          Re: Help on scripting or whatever?

                          I placed it in the events and made sure the object name was the same...
                          What event, how did you call it?

                          If you use the onchange event for the Assignnum field, you could code as

                          Assignnum_onchange()
                          There can be only one.

                          Comment


                            #14
                            Re: Help on scripting or whatever?

                            I placed it in the events only...
                            Below is what I used and in the forms it doesn't do as it does in the browse the same way...

                            -----------------------------------------------------
                            FUNCTION Assignnum_onchange AS V ( )
                            if between( Assignnum.value,"CAT001","CAT500")
                            Dept.value = "Catering"
                            else if between( Assignnum.value,"CON001","CON500")
                            Dept.value = "Concessions"
                            end if
                            END FUNCTION
                            ----------------------------------------------------------

                            Comment


                              #15
                              Re: Help on scripting or whatever?

                              Originally posted by kellerm View Post
                              I placed it in the events only...
                              Below is what I used and in the forms it doesn't do as it does in the browse the same way...

                              -----------------------------------------------------
                              FUNCTION Assignnum_onchange AS V ( )
                              if between( Assignnum.value,"CAT001","CAT500")
                              Dept.value = "Catering"
                              else if between( Assignnum.value,"CON001","CON500")
                              Dept.value = "Concessions"
                              end if
                              END FUNCTION
                              ----------------------------------------------------------
                              On a form the event is available from a right click on the object. Then select the onchange. It's actually easier (and has been available longer than the onchange in the browse).

                              You won't need the function format. Just put the code into the onchange event....
                              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

                              Working...
                              X