6 Replies Latest reply on Jul 26, 2016 10:03 AM by rrrichie

    Script button to add multiple records to related table (portal)

    ShaunGibbins

      Hi

       

      I am in the process of investigating the possibility of using FM to record surfacing extents and auto calculate a BOQ.

       

      I am stuck trying to create a button script that will pre-populate the BOQ items, I have managed to script adding one item but cannot work out how to add multiples. I want to create new record buttons for each work type that will pre-populate the material table with associated BOQ items into the new (job) record, the user will add measurements to the measure table and I intend to try and calculate totals to add to the quality field of the material table.

       

      So this works for a single item;

      Go to Portal Row [ Select ; First ]

      Insert Text [ Select ; Material::Item Number ; "712510"]

      Commit Records/Requests [ No dialog]

       

      Tried different variations of this but it only ever seems to add 1 row!

      Go to Portal Row [ Select ; First ]

      Insert Text [ Select ; Material::Item Number ; "712510"]

      Go to Portal Row [ Select ; Next ]

      Insert Text [ Select ; Material::Item Number ; "712520"]

      Commit Records/Requests [ No dialog]

       

      Any help would be greatly appreciated, I have used FM for basic projects but new to scripts.fm.png

      Relationships in case it helps

      fmdb.png