2 Replies Latest reply on Oct 28, 2012 5:03 PM by Edu

    Creating a new record from different layout and navigating to that layout, is it possible?

    Edu

      Title

      Creating a new record from different layout and navigating to that layout, is it possible?

      Your post

           I am using FM Pro 12 and I want to avoid using Portals.

           Can I create through a script a new record from a field that is not present in the current layout and then navigate to that layout?

        • 1. Re: Creating a new record from different layout and navigating to that layout, is it possible?
          philmodjunk
               

                    I am using FM Pro 12 and I want to avoid using Portals.

               Not using portals in FileMaker is like rowing a boat with only one oar--not likely to work well for you.

               Nevertheless, even with portals, it is often necessary to use a script to create a record in a table other than the table referred to by the current layout.

               The basic script is quite simple:

               Go to Layout [specify the layout]
               New Record/Request

               That satisfies the request that you posted. It navigates to a different layout and then creates a new record in that layout's table.

               But I suspect you need to see more than this happen. Often data, such as a primary key, needs to be copied from the current record of the current layout to the foreignkey field of the new record in the other table:

               Set Variable [$ID ; value: YourTable::PrimaryKey]
               Go to layout [Layout for Your Table 2]
               New Record/Request
               Set Field [YourTable 2::ForeignKey ; $ID]

               Note that any number of values can be loaded into variables and then transferred to the new record should that be necessary.

               PS. This post doesn't have anything to do with FM Server even though it was posted to the FM Server section. (See tabs at top of screen). Had it been posted to the FM Pro Forum section, it likely would have gotten a response the same day that it was posted.

          • 2. Re: Creating a new record from different layout and navigating to that layout, is it possible?
            Edu

                 Thank you for the explanation . It worked!  Apologies for not writing this topic in the correct section. I thought it was in FM Pro section.