6 Replies Latest reply on Feb 2, 2010 11:41 AM by philmodjunk

    Why do I get a New window



      Why do I get a New window


      I'm new to Fm and using Fm pro advance 10. I am using BPS-template as a starting place for our office database. I hope to make this database available over our network to the four people in our office. We do not publish anything on the web. We are in house only and using windows vista and a unix server.


      The problem I'm having right now is I'm trying to write a script / scripts that can allow me to jump back and forth between the contacts modual and projects and tasks modual. the template has a projects file that contains two tables projects and tasks and a contacts file that hosts our client data. the template's relationships were over my head and based on a contact/ task relationship when what I need is a contact / project relationship and a project task relationship but not necessarily a task/ contact relationship.


      I created a direct relationship between projets and contacts via Contacts_Id field. I want to be able to create a project in the project table and assign it to a client. that works fine. ( new project look up client data via contact_ID, great)) but if i jump to the related client via my script the realted contact shows inthe contacts file but I'm not taken to it I have to change over to the contacts window. Why??  I just want to be able to go to the clients data in the contacts file and back to the projects data in the projects file with a button. 


      my scripts look like this 

       goto related rocord [from table: "contacts"; external; using layout<current layout>]



       goto relatedrecord[table:projects 2"; External;using layout: "form view- projects" (projects)]


      why can't I "jump" ??




        • 1. Re: Why do I get a New window
             You can place a Select Window step after the Go To Related Records step to bring a different window to the front.
          • 2. Re: Why do I get a New window
               I tried but couldn't figure out how to assign the layout name from the project file. I tried to use the specify but I got a calculation that I didn't know how to do. I also tried to enter "layout name" ; file name but it didn't work
            • 3. Re: Why do I get a New window

              Select window selects a window name not a layout name. I don't have the business productivity pack so posted an answer based solely on the information in your first post. When using your system, WHen you pull down the windows menu (also check the Show> sub menu) do you see other windows listed? These are the names that select window can specify and thus pop to the front of the other windows.


              If you are working with just one file and the script is not selecting the correct layout, then it will help to see more of your script.


              From your original post:


              goto related rocord [from table: "contacts"; external; using layout<current layout>]


              goto relatedrecord[table: "Projects 2"; External;using layout: "form view- projects" (projects)]


              The first line doesn't specify a layout by name the way the second one does. That could be a clue.

              • 4. Re: Why do I get a New window

                Also, Go To Related Record can leave you on your original layout if there are no related records to "go to".


                Go To Related Records is a very useful tool, but which is very poorly documented. To learn more about GTRR, click the following link:

                The Complete Go To Related Record

                • 5. Re: Why do I get a New window

                  Thats' the whole script, one line, well now two B/C I addded the select window. but it still doesn't work.

                  If I understand the syntax of select window is

                  select window


                  window name "filename" 


                  do I need the path too if it's in the same path? 


                  For expedience, I let the script go and simply assigned the button to "go to related record" as follows

                  GTRR [from table:"tasks":using layout:form view]


                  As I understand it, from prior studying, it's generally a bad idea to have buttons assigned to steps all over your solution in case something changes your stuck trying to locate and change 100 buttons whereas if its in a script you just change the script and you're done.  This seems logical. 


                  Why would the direct button setup, as above, work fine but the same syntax in a script not work? is it me? 


                  • 6. Re: Why do I get a New window

                    The default name of a window is it's filename. That may not be the actual name of the window if a script renames a window or uses new window to open a new window for the current file and specifies a different window name. That's why I suggested checking the names listed in the window menu to be sure you are specifying the correct window by name. If this is a window from a different file, make sure you clear the "current file only" option.


                    "Why would the direct button setup, as above, work fine but the same syntax in a script not work? is it me?"

                    It's hard to say without examining your files. The only possibility that comes to mind is that the script will behave differently under two circumstances:

                    1. If a different layout is current.
                    2. If there are no matching related records. (This will leave you on the current layout.)

                    When using Go To Related Records, you should either first check for the presence of related records in the related table or check for error codes immediately after. The link I posted earlier gives you detailed examples of both methods.