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

New Browse and ViewQueried()

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

    New Browse and ViewQueried()

    I think this may be a bug, but would like to know if anyone else is experiencing the same. I am placing the browse button "Open Form" into an embedded browse to edit the selected record from the browse. This places the script in the Browse Events Events and uses the ViewQueried() function to pull up the same record you are viewing in the browse. It doesn't get the correct record unless it is the only one in the browse. Re-loaded a patch without the new browse and it works as advertised. If someone could verify this I would appreciate it.
    Thanks.
    Ernie

    #2
    Re: New Browse and ViewQueried()

    When I place a button in a column on an embeded browse, the event code is created as follows:

    FUNCTION Imagenbr_ButtonClick AS V ( event AS C, data AS C , row AS N )
    'DESCRIPTION: Fired when a button is clicked on a column.
    'Arguments: event - the name of the event that is fired
    ' data - the data in the column cell
    ' row - the row number in the browse
    'this.SetViewport_Row() sets the current row to the row with the button that was clicked.
    this.Set_Viewport_row(row)


    'I put the following code in.

    dim frm as p
    dim filter as c
    filter = "recnbr = " + recnbr.text
    frm = form.ViewQueried("frmclaimimages",filter)

    END FUNCTION

    I'm got the new browse version installed. Maybe you just need the

    this.Set_Viewport_row(row)

    part to set the row you're clicking on.

    Comment


      #3
      Re: New Browse and ViewQueried()

      David,
      I didn't add anything to what Alpha input into the event. I just went through the steps required in placing the button. I have checked it on other forms as well with same results.
      Ernie

      Comment


        #4
        Re: New Browse and ViewQueried() - FIXED??????

        Well, never mind. Even after all my testing and re-installing different patches from yesterday, I kept getting the same results. So decided to create a small app for submission here. It now decides to work with this small app. So went into the one I'm currently working on and it works. So really don't know what to say about it.
        Ernie

        Comment


          #5
          Re: New Browse and ViewQueried()

          Just because I saw the "ViewQueried", I'll put in my 2 cents. We are testing ver 9 with our ver 5 databases. In some instances, the call formViewQueried() works as advertized, in others, it doesn't. This is most disconcerting as we do this an awful lot!

          We have multiple applications where one form "calls" another. At times, we open a form in one database from a completely different database. All of this is via the "FormViewqueried()" code that Alpha produced.

          We found a work-around which actually brings up the "called" form much more quickly, by putting the filter into the on_init event of the called form, we can just do a form_view().

          In most instances, this will work, but if a form is both a "called" (queried) form as well as a stand-alone form opened from a menu form, this will be a problem.

          If anybody else hase seen this behavior, or knows why it might be happening on some forms, and not others, please let us know.

          Tom

          Comment


            #6
            Re: New Browse and ViewQueried()

            Tom,
            Thanks for the info. Would you mind sharing how you code this? What are you passing to the called form? Or are you having the called form look back at the calling form? Any info would really be appreciated.
            Thanks.
            Ernie

            Comment


              #7
              Re: New Browse and ViewQueried()

              Ernie... could you lay out the steps you followed to add the button? When I add a button to an embeded browse I have to do it manually. I'm pretty new to A5 still so I don't know all the different way to get the same thing done. Lay out the steps... I'd like to see what A5 does. Thanks.

              Comment


                #8
                Re: New Browse and ViewQueried()

                David,
                I'll see if I can do it and make it understandable. With the form opened in design mode, over on the right where the Drag & Drop list is there is also a window/form called "Browse Controls". Click on it to open it up and there is a selection called "Open Form". Drag this into the embedded browse. Then work thru the genie.
                HEre's a little "jingle" that shows it.
                Ernie

                http://www.lightningdesign.com/mypro...orm_Button.swf

                Comment


                  #9
                  Re: New Browse and ViewQueried()

                  Ernie,

                  Attached are 2 code samples. The 1st is what Alpha would typically generate when you want to open a form using a field on the current screen as a filter. The second sets a global varable to the field value, then just calls the 2nd form. My statement was a little misleading before. We don't do anything in the on_init process. The form properties are set with a filter as shown in the attached picture.

                  1st code (typical Alpha call)
                  Code:
                  ELSE IF  WORD(ANS1,-1) = "Dependents"
                    'debug(1)
                  	sys_send_keys("{F9}")
                  	'Check to see if you are running the script from within a Form
                  	dim flag_error as l
                  	flag_error = .f.
                  	if is_object(topparent.this) then 
                  		p = topparent.this
                  		if p.class() = "Form" then 
                  			DELETE Parameter1 
                  'Set the Parameter variable to the object's .value property
                  	Parameter1 = eval("P:MEDNO.value")
                  	 else    'Not in a Form. This is an error condition.
                    	   flag_error = .t.
                  	end if 
                     else
                  	flag_error = .t.
                  end if 
                  	
                  if flag_error then 
                    ui_msg_box("Error","You can only run this script from within a Form",UI_STOP_SYMBOL)
                    end 
                  end if 
                  			
                  filter = "Medicaidno = [varC->parameter1]"
                  query.filter = replace_parameters(filter,local_variables())
                  query.order = ""
                  			
                  'Open the layout_type showing just the records that satisfy the filter
                  DIM Shared varP_MED061_DEPENDENTS as P
                  DIM layout_name as c 
                  layout_name = "MED061 DEPENDENTS"
                  	
                  dim tempP as p
                  'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. 
                  'In case formname has spaces, normalize it
                  tempP=obj(":"+object_name_normalize(word(layout_name,1,"@")))
                  'Test if pointer is valid
                  if is_object(tempP) then 
                  'Test if pointer refers to a form or browse
                  if tempP.class() = "form" .or. tempP.class() = "browse" then 
                  'Apply the query to the form or browse as the Base query.
                  ' (this means that the user cannot turn the query off, only add to the query)
                  tempP.BaseQueryRun(query.filter,query.order)
                  'then activate the already open window
                  tempP.activate()
                  else
                  'Window is not already open, so open it
                  varP_MED061_DEPENDENTS = :Form.viewqueried(layout_name,query.filter, query.order )
                  	
                  end if
                  else 
                  varP_MED061_DEPENDENTS = :Form.viewqueried(layout_name,query.filter, query.order )
                  			
                  end if
                  END IF
                  Next code using the filtered form

                  Code:
                  FILT:
                  	Openn the layout_type showing just the records that satisfy the filter
                  					
                              [COLOR="Seagreen"]SSNANDMEDNO()[/COLOR] 'this is an internal function
                  	DIM Shared varP_061_CLIENT as P
                  	DIM layout_name as c 
                  	layout_name = "061 CLIENT"
                  	DIM tempP as p
                  	'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it
                  	tempP=obj(":"+object_Name_normalize(word(layout_name,1,"@")))
                  	if is_object(tempP) then 
                  	  if tempP.class() = "form" .or. tempP.class() = "browse" then 
                  		tempP.activate()
                  	    else
                  		varP_061_CLIENT = :Form.view(layout_name)
                  	  end if
                  	 else 
                  	 varP_061_CLIENT = :Form.view(layout_name)
                  	end if 
                  	END
                  Hope it helps,

                  Tom
                  Last edited by Tom Henkel; 03-27-2009, 01:47 PM. Reason: clarification

                  Comment


                    #10
                    Re: New Browse and ViewQueried()

                    Thanks, Tom. My "problem" was with placing a button as a column in an embedded browse to call the form as shown in the link of my previous post. In this case, Alpha creates a Button_click function in the Browse Event Events to call the form using viewqueried().
                    Ernie

                    Comment


                      #11
                      Re: New Browse and ViewQueried()

                      Thanks Ernie... I was adding a button to an existing column. Using the Browse controls, as you point out, adds a new column. Using this method seems fine on my install. The following code is created by the genie...

                      function Actions_ButtonClick as v( event as C,data as C, row as N)
                      this.Set_Viewport_row(row)
                      if this.Table_Get().Mode_Get() > 0 then
                      this.Commit()
                      end if
                      :Form.viewqueried("frmClaimImages",eval("\"Recnbr=\"+s_quote(Recnbr)",this.Name(16)+".this"),"","Normal","","",.t.)
                      end function

                      Comment


                        #12
                        Re: New Browse and ViewQueried()

                        David, that's it. As my original post said, yesterday it wasn't pulling up the record that was clicked on. Now it seems to be working fine.
                        Ernie

                        Comment

                        Working...
                        X