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



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

Grid Drop Down Box

  • Filter
  • Time
  • Show
Clear All
new posts

  • Grid Drop Down Box

    I know this is simple but I can't get the syntax right. I want to filter the values in a grid drop down box.

    The Drop Down Box is in the "Activities" grid on the "Activity_Contact" field. I need to filter records from the "Contacts" grid based on the "Account_id" which is present in the "Activities" grid and the "Contact" grid.

    I built a filter under "Choices" for the Drop Down Box "Account_id={Account_id}" but it doesn't work.

  • #2
    Re: Grid Drop Down Box

    Are you using V10? Are you trying to contrain the second dropdown based on the previous dropdown? - send a screen shot.
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)


    • #3
      Re: Grid Drop Down Box

      I am using Ver. 5.9. This is a simple, one level Drop Down Box.

      I think I have attached screen shots. We'll see.

      Thank you.
      Last edited by Dan_Foster; 08-27-2009, 10:07 AM. Reason: wrong images


      • #4
        Re: Grid Drop Down Box

        Still cannot figure this out. I am simply trying to figure out how to fileter a dropdown box with only contacts for the account.

        .DropDownBox.Filter = "Account_Id = Account_id"

        This is what I have now but all contacts come back to the DDB.


        • #5
          Re: Grid Drop Down Box

          Have you tried the following for syntax yet?
          DropDownBox.Filter = "Account_Id ="+quote( Account_id)

          I also dropped the period in front of
          which perhaps was just a typo.
          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


          • #6
            Re: Grid Drop Down Box

            I cut and pasted this code into the component and I got a publishing error "3". Also, the period was placed there by the Alpha 5. I tried taking it out but still got the error.


            • #7
              Re: Grid Drop Down Box

              I am going crazy and it will be a short trip according to my wife.

              I could sure use some help, nothing has worked so far.

              I have a parent table called "tbl_account" and a child table called "tbl_contact". They are linked with a common field called "Account_id" "Account_id" is a auto-incrementing numeric field in "tbl_account" and a numeric field in "tbl_contact".

              I have a grid called "pending" that is based on a table called "tbl_penidng". The "pending" grid is used to schedule and edit activities. The "tbl_pending" table is tied to the "tbl_account" with the "Account_id" field, just like "tbl_contact".

              The "Contact" field in the "pending" grid is a drop down box used to select which account contact is the target of the activity.

              My drop down box works but it returns every contact in the "tbl_contact" table. I want to filter the values based on the "Account_id" so I only get contacts associated with the account the activity is tied to.

              When I go to choices and try to build the filter, I cannot get it to work. I tried the centax that MikeC was kind enough to give me but I get an error when I go to live preview

              "500 Internal Server Error
              "Script Error
              Error:Invalid component format: Pending"

              Sorry to be so long winded. Thank you...


              • #8
                Re: Grid Drop Down Box

                Hi Dan,
                I hope you are not crazy, yet.
                I found a way to solve a problem that’s either similar or the same: filtering a dropdown on a child grid based on a value in a parent grid. I also tried the filter, but it just didn’t work (I think because of the way alpha five adds quotes to the expression).
                Here is a solution that does work for me(I am opening the child grid from the parent grid – I hope this applies to you):

                In the parent grid define a calculated field based on your account id:
                lk_account_id = tbl_account->account_id.
                Add it to your grid and select “link” as control type.
                Choose “computed from fields in the grid”; select the linking fields, then define a variable:
                “Variable name” = session.account_id and
                “Contains value” {account_id}
                (where account_id is the name of the field in the grid – I think it gives you a list of choices)

                Then go to the page that contains your child grid and override the dropdown for your contacts field by placing the following code after the with tmpl… section (after the component has been loaded with a5w_load_component(…):

                If eval.valid(session.account_id)
                field_info[n].DropDownBox.Filter = “account_id=”+quote(session.account_id)
                end if
                (look up “n” in the xbasic code of the child component)

                I hope this is helpful.
                Good luck,


                • #9
                  Re: Grid Drop Down Box

                  Thanks Simone.

                  I got lost when I tried to follow your instructions. My account_id field is already on my child table where the dropdownbox is located.


                  • #10
                    Re: Grid Drop Down Box

                    Hi Dan,

                    What I am describing in the previous post is how to:
                    create a parent grid (accounts). Each of its records contains a link to the child grid(activities). The link passes along the account_id as session variable. This id is then used to override the filter for the contacts dropdown in the child(activities) grid.

                    In more detail: add a field to the parent (account) grid that has control type “link” (additionally to the account_id field). Select “Static text” under “Display what in link?” and set the text to something that makes sense, such as “edit account activities”. When the user clicks on it (it shows up for every account record with the same label) it brings him to your child(activities) grid, the one that is based on tbl_pending, because that’s how you define it: as link address type you select “Computed from fields in the grid”. Then, when you click on the button on the link address line, you get a window that allows you to pick the page to which the user will be redirected. Pick the child page that’s based on tbl_pending and select the account_id field as linking field. Then define the variable (in the same screen) as I describe in the previous post.

                    So at this point, you have a parent page that displays your parent grid, the account grid. It has an account_id field which may be invisible and it has a link field that’s based on the account_id field which is visible. It displays the static text “edit account activities”. When the user clicks it, he is sent to the child page which displays data for the account_id of the record that was selected on the parent grid.

                    The child page knows what this account id is because it was passed along to it in the session variable.

                    When you define your contacts dropdown in the child grid, the data comes from the contacts table which also contains the account_id. Since setting the filter in the child grid doesn’t seem to work, you can override the filter definition for the contact dropdown in the child grid’s page. In the child component go to the xbasic tab and look for the contacts dropdown. It is referenced with a number: you should see something like: with tmpl.field_info[3] .Fieldname = "contacts" . So, remember the “3”.

                    Then go to the child grid’s page. It loads the component. After it has done so you can override the filter for the contacts dropdown. I think what I put in the previous post should work. So this means the contact information is taken from the contacts table, but only for the account_id that belongs to the parent grid record for which the user opened up the child (activities) page.

                    This is all terribly long winded. I hope it makes some sense.
                    Good luck,