2 Replies Latest reply on Jun 5, 2012 11:06 AM by LievenFocquaert

    Pass variables between layouts



      Pass variables between layouts



      I'm rather new to using filemaker pro.

      I am setting up a screen navigation similar to the starter solutions in FM12.  I have a project where issues are listed on (instead of tasks in the starter solutions).

      I want to navigate from the project layout to the issues layout.  I am passing the project code in the script behind the button to navigate.  Now the question is how do I populate the project code on the issue layout?

      Thx in advance for any clarification.


        • 1. Re: Pass variables between layouts

          Have you defined two tables in Manage | Database? Projects and Issues?

          Did you link them like this on the relationships tab?

          Projects::Project Code = Issues::Project Code

          Is Project Code an auto-entered serial number?

          If so, use the onRecordLoad script trigger on your Project Code layout to do this:

          Set Variable [$$ProjectCode ; value: Projects::ProjectCode]

          (Using two dollar signs as the start of a variable's name makes it a global variable accessible throughout the database and a value stored in it will persist until you close the file.)

          Then go to manage | database | fields, find Issues::Project Code and double click it.

          Click the auto-enter tab and select the calculation option.

          enter this as the calculation: $$ProjectCode

          Now any new record you create on the Issues layout will create a new issues record and link it to the current record on the project code layout, provided you visit the project code layout first.

          You can also use either Go to related records or a scripted find with a button on the Project Code layout to bring up a found set of related issues on the Issues layout.

          You can also display the issues records on your Project Code layout in a small scrolling window if you add a portal to Issues on the Project Code layout. If you enable "allow creation of records via this relationship" for Issues, you can add new related issues records directly in the portal and FileMaker will link the two by copying the Project Code of the current Project Record into the Project Code field of the new issues record and you don't have to use the previously described scripting, global variable and auto-enter calculation.

          • 2. Re: Pass variables between layouts

            Hi PhilModJunk,

            thx for the answer, it helped me a lot....