1 Reply Latest reply on Jul 24, 2013 10:51 AM by philmodjunk

    Add records through portal with the Header changing it's values

    DranLang

      Title

      Add records through portal with the Header changing it's values

      Post

           Hi everyone! It's been more than 2 months now I'm using FM Pro and now I'm currently doing portals but I've got a situation where I have a header and body (layout parts) and my portal connected to a different table.

           My header consists of values from my TABLE1 and TABLE2, where my TABLE 2 is my current table as per the layout I'm using.  The values from both tables are linked by JobID.  Then I have a button which will run a script when clicked.  The script is written as follows:

           Go to Layout ["LAYOUT NAME" ( TABLE NAME)]

           Set Variable [$$Job_ID; <VALUE>]

           Set Variable [$$Job_No; <VALUE>]

           New Record/Request

           Set Field [<TABLE NAME::JobID; $$Job_ID]

           Set Field [<TABLE NAME::JobNum; $$Job_No + 1]

           In my current layout, I have a portal that adds records to the TABLE 2.  But when I click the NEXT JOB button, the other fields that are not in the layout will clear out and I can add new entries but for the fields in the portal, they stay and if I change something they will be reflected in the previous record.

           Is there something missing or I need to change in my script? 

           All suggestions will really be appreciated.

            

           Cheers

        • 1. Re: Add records through portal with the Header changing it's values
          philmodjunk

               How's that again?

               I find your post very confusing. is JobID the primary key for Table 1 or Table 2?

               Does layout setup for your layout refer to table 1 or table 2?

               Does portal setup for your portal refer to table 1 or table 2? (you seem to have indicated that both layout and portal are based on table 2--which is very unlikely and would only work with two table occurrences of table 2.)

               And does your script reference records in table 1 or table 2? (The steps simply refer to "table"...)