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

Another session variables question

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

    Another session variables question

    Hi All.

    I have a straight forward question on session variables.

    After running an a5w page with a search grid, i am presented with the results. I have created a link on the results, so that when the link is selected a (new) page is opened with more details on this item.

    My problem is im not sure if i am getting the session variables process right.

    I have placed the following code in my searchasset.a5w page with the search grid. I was hoping this would set the session variable for the field asset_id.

    Code:
    session.vasset_id = "asset_id"
    then

    In the link address on the searchassets grid component i have placed the following code;

    Code:
    itas_history.a5w?itas_history_filter=asset_id={asset_id}
    This opens the correct a5w page and filters to the asset_id.

    What i now need to do is when the itas_history.a5w page is open and you enter a record, the asset_id field for this new record will be populated with the asset_id of the item selected.

    I have put the following code in the beforevalidatenewrecords event;

    Code:
    DataSubmitted.asset_id = session.vasset_id
    This will put the value of the session.vasset_id in the asset_id field.

    So i know i am nearly there. My BiG question is how do i create the session.vasset_id variable in the first place so the rest of my code works.

    #2
    This statement doesn't work:
    Code:
    session.vasset_id = "asset_id"
    If you were setting the session variable in a grid event, you would have to use the syntax described in Using Grid Events.

    Comment


      #3
      Thanks Edward. I have read the document and i am even more confused. I have spend 2 days trying to get this to work and i think i am going in circles. Can you give me an idea of the syntax i need to get this to work please. Im sure its very straight forward but i just cannot seem to get my head around this one.

      I tried typing in this in the BeforeValidateNewRecords.

      Code:
      Args.DataSubmitted.R1.ASSET_ID=session.vasset_id
      but i get the following error when i try to view the session.vasset_id variable on a new page;

      500 Internal Server Error
      Script Error
      Error:Script: /addnote.a5w line:36
      ? session.vasset_id
      Property not found
      session.vasset_id subelement not found.
      Last edited by den1s; 03-22-2006, 10:27 AM.

      Comment


        #4
        BUMP!. Really stuck here guys. Please help!

        Comment


          #5
          Try this code:

          Code:
          if eval_valid("session.vasset_id") then
          Args.DataSubmitted.R1.ASSET_ID=session.vasset_id
          end if
          If the error goes away, it means that session.vasset_id does not exist.

          Comment


            #6
            I will explain what i am doing. I will be as precise as possible as i am desperate to get this one resolved.

            I have a grid called SEARCHASSETS.a5wcmp.
            Within this grid i have the asset_id field, which is a read only label field.
            In the BeforeValidateExistingRecords i have placed the code you just gave me

            Code:
            if eval_valid("session.vasset_id") then
            Args.DataSubmitted.R1.ASSET_ID=session.vasset_id
            end if
            I was hoping the above code would create the session.vasset_id variable.

            I have a search part on this grid which basically searches the data from the assets table. I have placed a link field on each line of the search results which when pressed will do the following

            Code:
            ithistory.a5w?ithistory_filter=asset_id={asset_id}
            This opens the ithistory.a5w page and displays only the records where the asset_id is equal to the item originally selected.

            In the ithistory page (which is a note log of maintenance calls placed the particular asset) i have a button called ADD NEW NOTE. When this button is pressed, i have a Add Record Only grid open which allows me to add another note.

            DATE - TYPE - NOTE

            I have the following code which auto populates some fields in this grid.

            Code:
            function BeforeValidateNewRecords as v (DataSubmitted as P, Args as p, PageVariables as p)
            with PageVariables
            DataSubmitted.company_id = session.vcompany_id
            DataSubmitted.ASSET_ID = session.vasset_id
            DataSubmitted.date = now()
            end with
            end function
            The line below isnt working as i cannot seem to create the session.vasset_id variable.

            Code:
            DataSubmitted.ASSET_ID = session.vasset_id
            I get the following error when i click on the button to open the add notes grid

            Error executing BeforeValidateNewRecords event handler: command: DataSubmitted.ASSET_ID = session.vasset_id Property not found session.vasset_id subelement not found.

            Please help.
            Last edited by den1s; 03-23-2006, 10:46 AM.

            Comment


              #7
              Remember that a session variable does not exist until after it is created with either (1) a dim statement or an (2) assignment and (3) the page has been submitted back to the server at least once.

              Comment


                #8
                Its all a huge learning curve for me thanks for all your advise Edward.

                At which point in my application is it best to create the session.vasset_id and how would you reccomend i do that. One example syntax would be very helpful.

                Comment


                  #9
                  Denis,

                  I don't know if this helps you: I did the following and it seems to work:

                  In a grid I created a computed link like:
                  pagename.a5w?session.member={Member_Id}
                  From that moment on, I can use the variable session.member.

                  Good luck!
                  Ren�
                  Windows 7, V11

                  Comment


                    #10
                    I suggest that you go to the webhelp and look in the index under Session Variable. You will see a number of examples.

                    Comment


                      #11
                      I just did an experiment. This creates a session variable. The code is in the BeforeSearch event of the grid:
                      Code:
                      function BeforeSearch as v (SearchDataSubmitted as P, Args as p, PageVariables as p)
                      with PageVariables
                      	session.lastname = SearchDataSubmitted.LASTNAME 
                      end with
                      end function
                      This code in the BeforeValidateNewRecords event writes this value to the lastname field of the new record.
                      Code:
                      function BeforeValidateNewRecords as v (DataSubmitted as P, Args as p, PageVariables as p)
                      with PageVariables
                      	DataSubmitted.LASTNAME = session.lastname
                      end with
                      end function

                      Comment


                        #12
                        Thanks Rene for your example. I have tried this and yes it does work, but my only problem with this is that it appears in the URL, and i found users can change the value to view other records. When i attempted to use __protected__ variable in this type of command, it appeard not to recognise the __protected__ variable.

                        Also thank you Edward. Very helpful. I have implemented your example and it works to a degree... The variable session.LASTNAME is captured on the search part only and if say you entered SM instead of SMITH for the search, the value SM becomes the vallue in the session.LASTNAME. How can I get this to take the whole value from the LASTNAME field in the table, .i.e. SMITH.

                        Comment

                        Working...
                        X