AnsweredAssumed Answered

Using values entered into a portal as a variable

Question asked by atrinabrill on Mar 9, 2018
Latest reply on Mar 9, 2018 by philmodjunk

Hi there!


I have a table "Acct" with a portal to a child table "SubContract" that I would like to put data into (SubContract::_fkOrgID & SubContract:: Years) that should do a couple of things.

1) Selecting a new value for _fkOrgID (It's a value list based on a table "Org") that is not part of the value list should prompt users to input information about the new org (e.g. Org::Name)

2) Inputting data into SubContract::Years should create new records (n=SubContract::Years) into "SubContractYrs" (Child table of SubContract) that inputs the data from SubContract::__pkSubContractID & Subcontract::_fkOrgID, into SubContractYrs::__fkSubContractID & SubContractYrs::_fkOrgID respectively.

*This should be done for each of the records in the portal.


I have created the correct number of SubContract records based on the following script that is triggered by the input of data into the layout of the Grant table, which is a parent table of SubContract, but the same thing doesn't seem to work for portals?


Set Variable [$OrgID; Value: Grant::_fkOrgID]

Set Variable [$howMany; Value: Grant::NumSubcontracts]

Set Variable [$theCount; Value: 0]

Go to Layout ["Subcontracts" (SubContracts)]


     Exit Loop if [$howMany > $theCount]

     New Record/Request

     Set Field [SubContract::_OrgID; $OrgID

     Set Variable [$theCountSubContractYrs; Value: $theCount + 1]

End Loop


Any help or guidance?