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

Open Xdialog as Form?

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

    Open Xdialog as Form?

    I have a dialog box that I want to open from my main menu before opening another form. The dialog will ask for user input which will open a form queried with the specified information for a record.

    Do I place the xdialog on a blank form, name the form, and then link it to the main menu..... or can I just create the dialog and then link to it from the main menu using an event but without placing it on a form? I'm confused as to how best to do this.

    Thanks for your help.

    #2
    Re: Open Xdialog as Form?

    I have a dialog box that I want to open from my main menu before opening another form.
    Usually a button is placed on a form and its code is the xdialog script.
    There can be only one.

    Comment


      #3
      Re: Open Xdialog as Form?

      The form I want to open is the tabbed employeeinformation form with payroll, performance, etc. When I open the form, the fields automatically have the first record filled in; however, I don't want that. I want the form to open with the record the user is looking for, so the xdialog would ask the user for first and last name.

      I want the xdialog to open before that form or be set up as a popup window to ask for input...then the employeeinfo form will open with that information.

      Comment


        #4
        Re: Open Xdialog as Form?

        On a button on your main form, you would create a dialog where you would ask for specific parameters. Those parameters would be variables used to set up a form.viewqueried() to your next form.

        In our system, we give the employees the ability to see what time they have available to take off. If the employee is a supervisor, we give thm te ability to see the time available for their immediate subordinates.

        The following code snippet will ask if the supervisor wants to see their employee's time and then filters the next form based on their input. The variable "access" is a unique identifier for the person logged on.

        Code:
        dim name as C
        dim sup as C
        dim sup1 as N
        dim shared access1 as N
        
        'determine if there are employees reporting to this person
        sup= upper(trim(lookupc("F",access,"name","secure2.dbf","access")))
        sup1 = lookupn("F",sup,"emp_id","g_employ.dbf","name")
        supok = ""
        if exist(sup1,"g_employ","Supvr_Id")
        	'employees report to this person, go on
            supok = "Y"
          else
          	supok="N"
          	end if
        
        nopg = " "
        sup= upper(trim(lookupc("F",access,"name","secure2.dbf","access")))
        IF (ACCESS <99 .OR. ACCESS >999) .and. supok = "Y"
        
        	pers = ui_msg_box(aa.bcbss.agency+" Personnel System","The Next Screen will Display YOUR Available Time."+chr(13)+chr(13)+"Is this what you want to do??",35)
        	if pers = 2 then
        		ui_msg_box(aa.bcbss.agency,"Action cancelled at user request")
        		end
        	end if
          ELSE
          	PERS = 6
        END IF
        
        if pers = 6 then
        	'yes selected
        	sup1 = lookupn("F",sup,"emp_id","g_employ.dbf","name")
        	nopg = "X"
        	[B]filter = "EMP_ID = [varN->sup1]"
        	query.filter = replace_parameters(filter,local_variables())
        	query.order = "NAME"[/B]
        	'Open the layout_type showing just the records that satisfy the filter
        	Form.ViewQueried("fEE_TimeAvail",query.filter,query.order)
        I hope this helps a little bit.

        Tom
        Last edited by Tom Henkel; 10-30-2009, 02:05 PM. Reason: can't read colors - removing

        Comment


          #5
          Re: Open Xdialog as Form?

          This is my code to open the form Employeeinfo, but alpha says that there are extra characters at the end...can someone tell me where my errors are?

          'Create an XDialog dialog box to prompt for parameters.
          DIM Firstname as C
          DIM Lastname as C
          DIM varC_result as C
          ok_button_label = "&OK"
          cancel_button_label = "&Cancel"
          varC_result = ui_dlg_box("Enter Employee Name",<<%dlg%
          {region}
          First Name:| [.40Firstname];
          Last Name:| [.40Lastname];
          {endregion};
          {line=1,0};
          {region}
          <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
          {endregion};
          %dlg%)
          dim frm as P
          dim filter as C
          dim order as C
          filter="Lastname="+quote(Lastname)t".and.Firstname="+quote(Firstname)
          order="Lastname+Firstname"
          frm=form.viewQueried("Employeeinfo",filter,order)

          Comment


            #6
            Re: Open Xdialog as Form?

            Ok, script runs the dialog correctly but no form.

            Help>

            'Date Created: 30-Oct-2009 01:36:20 PM
            'Last Updated: 30-Oct-2009 01:36:20 PM
            'Created By : Owner
            'Updated By : Owner
            'Create an XDialog dialog box to prompt for parameters.
            DIM Firstname as C
            DIM Lastname as C
            DIM varC_result as C
            ok_button_label = "&OK"
            cancel_button_label = "&Cancel"
            varC_result = ui_dlg_box("Enter Employee Name",<<%dlg%
            {region}
            First Name:| [.40Firstname];
            Last Name:| [.40Lastname];
            {endregion};
            {line=1,0};
            {region}
            <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
            {endregion};
            %dlg%)
            dim frm as P
            dim filter as C
            dim order as C
            filter="Lastname+Firstname"
            order="Lastname+Firstname"
            frm=form.viewQueried("employeepp","Lastname+Firstname","Lastname+Firstname")

            Comment


              #7
              Re: Open Xdialog as Form?

              Code:
              filter="Lastname="+quote(Lastname)[COLOR=darkred]"t"[/COLOR]".and.Firstname="+quote(Firstname)  ' I think
              <[COLOR=darkred]"*"[/COLOR]15=ok_button_label!OK> <15=cancel_button_label!CANCEL>  ' not a mistake, but removing will allow enters instead of forcing the user to use the tab button.
              I am not great with dialog boxes, but it seemed to be.


              .
              Dave Mason
              [email protected]
              Skype is dave.mason46

              Comment


                #8
                Re: Open Xdialog as Form?

                Originally posted by wlk8791 View Post
                This is my code to open the form Employeeinfo, but alpha says that there are extra characters at the end...can someone tell me where my errors are?
                It's in your filter:

                filter="Lastname="+quote(Lastname)t".and.Firstname="+quote(Firstname)

                Should be:
                filter="Lastname="+quote(Lastname)+".and.Firstname="+quote(Firstname)

                and while we are at it, change the order to:

                order="Lastname-Firstname"

                And to answer your original question, add an icon to your custom toolbar (or an item to your custom menu, or your tree or whatever you are using) to open the xdlg.

                Comment


                  #9
                  Re: Open Xdialog as Form?

                  Thanks so much....that fixed it...

                  :)

                  Comment


                    #10
                    Re: Open Xdialog as Form?

                    You snuck one more post with a different question.
                    This "Government Option" xdlg is NOT going to do the job for you.
                    Whether the user clicks OK or Cancel, it will open the form regardless.
                    I have to attend to some other matters right now, will get back with later, but this is bread & butter I am pretty sure lots of help will be coming your way.

                    Comment


                      #11
                      Re: Open Xdialog as Form?

                      It's running fine when ran from code editor, but not directly from the form. Says no records

                      Comment


                        #12
                        Re: Open Xdialog as Form?

                        This is not really an elegant one, but just a quick fix for your xdlg:
                        Code:
                        DIM [B]global [/B]Firstname as C
                        DIM [B]global [/B]Lastname as C
                        DIM varC_result as C
                        ok_button_label = "&OK"
                        cancel_button_label = "&Cancel"
                        varC_result = ui_dlg_box("Enter Employee Name",<<%dlg%
                        {region}
                        First Name:| [.40Firstname];
                        Last Name:| [.40Lastname];
                        {endregion};
                        {line=1,0};
                        {region}
                        <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
                        {endregion};
                        %dlg%, <<%code%
                        if a_dlg_button="OK"
                        dim frm as P
                        filter="your_lastname_field=Lastname"+".and.your_firstname_field=Firstname"
                        order="your_Lastname_field+your_firstname_Firstname"
                        frm=form.viewQueried("employeepp",filter,order)
                        end if
                        %code)
                        Let's hope that those fields in the table do not have the same names as the variables, i.e. Firstname & Lastname.

                        Comment


                          #13
                          Re: Open Xdialog as Form?

                          Correction:
                          this:
                          filter="your_lastname_field=Lastname"+".and.your_firstname_field=Firstname"

                          Should be:
                          filter="your_lastname_field="+quote(Lastname)+".and.your_firstname_field="+quote(Firstname)

                          Comment


                            #14
                            Re: Open Xdialog as Form?

                            Says: Error at line 7, column 1
                            Missing tag string end construct



                            'Create an XDialog dialog box to prompt for parameters.
                            DIM Firstname as C
                            DIM Lastname as C
                            DIM varC_result as C
                            ok_button_label = "&OK"
                            cancel_button_label = "&Cancel"
                            varC_result=ui_dlg_box("Enter Employee's Name",<<%dlg%
                            {region}
                            First Name:| [.30Firstname];
                            Last Name:| [.30Lastname];
                            {endregion};
                            {line=1,0};
                            {region}
                            <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
                            {endregion};
                            %dlg%), <<%code%
                            if a_dlg_button="OK"
                            dim frm as P
                            filter="your_lastname_field="+quote(Lastname)+".and.your_firstname_field="+quote(Firstname)
                            order="your_Lastname_field+your_firstname_Firstname"
                            frm=form.viewQueried("employeepp",filter,order)
                            end if
                            %code)

                            Comment


                              #15
                              Re: Open Xdialog as Form?

                              Code:
                              varC_result=ui_dlg_box("Enter Employee's Name",<<%dlg%   ' should there be a ")" here?
                              if a_dlg_button="OK"   ' should there be a "then" here?
                              Maybe I am not so smart on this, just looking and saw.

                              .
                              Dave Mason
                              [email protected]
                              Skype is dave.mason46

                              Comment

                              Working...
                              X