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

Problem with "Displaying a Selected Record in a Dialog"

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

    Problem with "Displaying a Selected Record in a Dialog"

    Because of the current inability to change a field based on another fields drop-down selection in a grid component (see previous thread "Filtering drop-down from prior selection"), I resorted to using a dialog component that now allows this feature. However, I'm having a problem linking the selected record from the grid to the dialog.

    I followed the help file instruction ("Passing a Record From a Grid to a Dialog") and everytime I select the record from the grid, it stops at the transition.a5w page and I get the following error:

    "...500 Internal Server Error
    Script Error
    Error:line:9 Missing or invalid keyword

    ----------------------------------------------------------------------
    Alpha Five/7.0 Build/4076-3031 at ..."


    The grid page is "user_accounts.a5w"
    The grid component is grid component is "user_list"
    The "key" field is "Logon_Id" which is also in the "results" a5w page (user_update.a5w).
    The "link properties" in the "Logon_Id" field in the grid has "Computed from fields in the Grid" selected in the "Link address type" and the "Link Address" is as follows: "transition.a5w?logon_id={Logon_Id}" (without the quotes).

    The transition page is "transition.a5w" that contains the following code (right from the help file with appropriate variable changes):

    <%a5w
    if (eval_valid("Logon_Id") = .F.) then
    response.redirect("user_update.a5w")
    end
    end if
    dim t as P
    dim url as C
    t = table.open("login")
    t.order("logon_id")
    t.fetch_find(logon_id)
    url = "user_update.a5w?logon_id="+alltrim(t.Logon_id)+"&name="+alltrim(t.Name)+"&fname="+alltrim(t.Fname)+"&lname="+alltrim(t.Lname)
    t.close()
    response.redirect(url)
    %>

    Not being familiar with XBasic (long time Delphi programmer), I'm not sure if the error is pointing to the line: t.fetch_find(logon_id) or the line prior or after. I tried using quotes (t.fetch_find("logon_id")) but it made no difference.

    I might mention, at this point, that I also tried using the help file "Displaying a Selected Record in a Dialog" instruction but the result page would always return the first field even though the URL showed the correct "key" variable. If anyone wants more detail on THAT issue, just ask =)

    I've tried to explain the problem as best I could but probably missed something somewhere. Any help in this issue would be GREATLY appreciated!

    Thanks, Edward, for the info on version 8 release and thanks to everyone for reading this long post!
    Last edited by eduran582; 06-20-2006, 11:34 AM.

    #2
    hi Eric

    i think that you need to get a pointer to an index or query

    see
    http://support.alphasoftware.com/alp...TCH_FIND().htm

    in the help file

    dim tbl_product as P
    dim indx_1 as P
    tbl_product = table.open("c:\data\product.dbf")
    indx_1 = tbl_product.index_primary_put("id_index")

    like this before you do your fetch_find

    hth
    martin
    regards

    martin
    www.jollygreenthumb.com

    Comment


      #3
      Thanks, Martin, for the info on the "pointer" and the link to the related help section. I tried what you (and the help) suggested but was met with the same syntax error.

      I think I'm going to abandon this line of "linking" and see what I can come up with (another post) using "Displaying a Record in a Dialog". It does not need the intermediate page (transition.a5w, I used in this case) and if you have a large number of fields would probably make the URL generated too long. The "Displaying a record..." method is simpler and I can always use the "lookup" feature and "AfterUpdateRecords" Event to minipulate any fields that have to be adjusted using XBasic (I think) before saving the record.

      Thanks again for your help!

      Comment


        #4
        Eric,

        I am at the same point as you and need to establish a method to incorporate cascading dropdowns in a dialog and pass this information to a table. If/When you manage to find a solution, could you please post it.

        Thanks in advance.

        Denis

        Comment


          #5
          One idea to go from the grid to the dialog would be to set a session variable in the link and then set the value of the dropdown equal to the session variable.

          So, for example, you have a grid that contains a field "user_id" and you want to go to a dialog that has a dropdown of user_Id's, and you want the one you linked from to show as selected. Name the dropdown box in the dialog as vUser_Id.

          So, the link would be

          DialogBoxName.a5w?session.User_Id={User_Id}

          Now, in the initialize event for the dialog, set the value equal to the session variable.

          If eval_valid("session.User_Id")=.t.
          vUser_Id=session.User_Id
          end if

          So, now if you go to the dialog box page and there is no session.User_Id set, you will see all the dropdown choices, but if the session variable is set, that one will be selected.

          Pat
          Pat Bremkamp
          MindKicks Consulting

          Comment


            #6
            Hi, Pat
            Thanks for the suggestion. However, if I have the same User_Id in several records (in my case it's "Access") the link would probably give me the first instance it finds. The uniqe field in my case is the Logon_Id and the field I would be changing, using a drop-down, would be Access which is actually one of a couple that would be changed.

            Here's what I've got:
            I have a grid with several fields and want to be able to select one of them and go to another dialog, grid, or whatever that will allow me to change certain fields based on a multi-selection component (drop-down). The result of that change would also change other fields based on the selection.

            Here's my solution...so far (incomplete):
            I've resorted to using the [simple] grid with Detail View and in the fields I want to change, I'm now using "lookup". I can select the desired value from the grid that is presented by clicking on the lookup and insert it into the field I want to change. This seems to work well as the resulting selection is replaced when I save the record.

            Now to part 2 of my problem:
            I am having a time trying to figure out how to take this changed selection (or any field for that matter) and based on it's value, change another field. Most of my problem lies in me learning XBasic, it seems, as some of the functions seem similar to another language I've used for years (Delphi). Not only am I having issues with the syntax but also what seems like something simple: WHERE to put the code?

            Example: The field with the lookup is called "Access" with the variable "accessw" which is a character field ("LINE STAFF", "SUPERVISOR") and the values from the lookup are located in a db which also lists the appropriate access_level (numeric: 1, 3). What I want to do when "Submit" is pressed is to be able change the access_level value based on the accessw value before the record is saved. I've found a function I think might work but cannot figure out how or where to put it or even if the syntax is correct:
            access_level=case(accessw="LINE STAFF",1,accessw="SUPERVISOR",3)

            A simpler version would be where the grid contains a LastName and FirstName field and you want to save it to another field called FullName where (I suppose) you could use:
            FullName=alltrim(Lastname)+", "+alltrim(FirstName)

            Either way I still need help in the syntax and where to put it. ANY help to get me on the right track will be appreciated!

            Oh, and Denis you can bet I'll post whatever solution I find. I don't know if you saw that version 8 is suppose to have the drop-down selection feature available in the grid component. But until then, I've got to find a solution for the current version.

            Eric

            Comment

            Working...
            X