2 Replies Latest reply on Jul 1, 2013 4:30 PM by malijames

    Create new record request



      Create new record request


           I have the following tables

           1.   tblSession  fields are       pk_session_id,  session_name

           2.   tblTerm  fields are      pk_Term_id,   Terms,  fk_session_id

                  the tables are related by  pk_session_id   and   fk_session_id

           there is a layout based on the session table and a portal base on the term table on that the session layout

           Now i will like to script that will

            1. create a new record in the session layout

            2. Create three new  relatated records in the  portal

            2. setfield (Terms)   on the related portal to

               first record should read   "1st Term"

                second record  should read   "2nd Term"

                 third record should read   "3rd Term"

           i believe the three newly created related record will have the same   fk_session_id


           i dont know much about script

           any help please

        • 1. Re: Create new record request

               Set Variable [$ID ; Value: tblSession::pk_Term_id ]
               Freeze Window
               Go To Layout ["Term" (Term)]
               New Record/Request
               Set Field [Term::fk_Term_id ; $ID ]
               Set FIeld [Term::Terms ; "1st Term" ]
               New Record/Request
               Set Field [Term::fk_Term_id ; $ID ]
               Set FIeld [Term::Terms ; "2nd Term" ]
               New Record/Request
               Set Field [Term::fk_Term_id ; $ID ]
               Set FIeld [Term::Terms ; "3rd Term" ]
               Go to Layout [original layout]

               Note: I am learning that this is not an ideal script to use with FileMaker GO on an iOS device.

          • 2. Re: Create new record request

                 like you have always done , everything works perfectly  . i just added   

                 New Record/Request

                 to the beginning of the script as the three newly created records relates to another new record in the parent table(session)

                 the script is to be used on window pc not    iOS device

                 thanks again for this perfect script