1 Reply Latest reply on Jan 3, 2013 7:29 AM by philmodjunk

    Script for "automated" data entry using portal

    wilz

      Title

      Script for "automated" data entry using portal

      Post

            

           Need some help writing a script that "automatically" enters data for me.  Ive got some of it written, but cannot get the desired result.

           The process I'm trying to create:
      Step 1: "Maunally" Enter Data in "Portal Test"

           Project ID(PK)    TeacherName   TaName
           HE001                 John 

      Step 2: "Manually" Enter data in "Proposed" 
           Project ID(FK)    Class Name     StartDate         Finish Date
           HE001                 English Lvl1     01Jan2012     04Jan2012
           HE001                 English Lvl2     01Jan 2012    04Jan 2012

      Step 3: Run script to automatically fill in "Actual" so it will end up looking like this.  
           ProjectID (FK)   Class Name    Teacher Name   Date
           HE001                English Lvl1   John                      01Jan2012
           HE001                English Lvl1   John                      02Jan2012
           HE001                English Lvl1   John                      03Jan2012
           HE001                English Lvl1   John                      04Jan2012
           HE001                English Lvl2   John                      01Jan2012
           HE001                English Lvl2   John                      02Jan2012
           HE001                English Lvl2   John                      03Jan2012
           HE001                English Lvl2   John                      04Jan2012

           LAYOUT SETUP
           ON the "Portal Test" Layout, I have setup a portal to "Proposed" (so I can enter them all in one go).
           Relationships are setup so the ProjectID is automatically filled in. 

           PROBLEM
           Seems taht whatever I try to do, the script only knows to enter the "English Lvl1" and not for "English Lvl2".  

           I'm pretty sure I have multile problems (Design problem? Wrong script logic? Wrong script usage?) Anywa any help would be greatful.  Thanks! 

      Portal_Script_Help.jpg

        • 1. Re: Script for "automated" data entry using portal
          philmodjunk

               I think that the change in layouts "loses" the focus on the current row in your portal on Portal Test. Also, go to portal row cannot specify a particular portal so care must be taken if your layout should ever have more than one portal or it may go to the portal row. of the wrong portal Give your portal's an object name and use go to object just before go to portal row to be sure that you are interacting with the correct portal.

               Given those issues, you may want to consider one of two approaches that avoid intracting with specific portal rows:

               1) Use Go to Related records to pull up a found set of records from the portal test layout's portal on a layout based on the portal's table and loop through those records. Changing layouts will not change which record is current.

               2) Use set Variable [$TheList ; value List (Proposed::Class Name ) ]

               to capture the full list of values from the portal in a list. Then use a counting variable such as $K and the function GetValue ( $TheList ; $K ) to refer to a specific value in the list. This last option can result in faster execution--a key advantage when working with large sets of related records and or slower connections such as that from a device using FMGO.