AnsweredAssumed Answered

Updating records

Question asked by tays01s on Sep 26, 2015
Latest reply on Sep 28, 2015 by electon

I have the following table relationships:

Patient < Calc < IO < Nut_calcs > Nut_eqs

&

Patient < Nut_calcs 2 > Nut_eqs 2.

 

I want to be able to evaluate Nut_eqs to produce results that appear in a Nut_calc 2 portal on Patient layout. The script below allows creation of record sets (51 calcs to be evaluated from Nut_eqs), it usess. However,

 

Set Field [ Patient::IO_n; IO 2::__ID ]

Set Variable [ $nutcalc_ioID; Value:Patient::IO_n ]

Go to Related Record [ From table: “Nut_calcs”; Using layout: “Nut_calcs” (Nut_calcs) ] [ Show only related records ]

Go to Layout [ “Nut_calcs” (Nut_calcs) ]

If [ IsEmpty (Nut_calcs 2::_IDIO ) ]

Loop Set Variable [ $i; Value:$i+1 ]

Exit Loop If [ $i = 52 ]

New Record/Request

Set Field [ Nut_calcs::_IDNut_eqs; $i ]

Set Field [ Nut_calcs::_IDIO; $nutcalc_ioID ]

End Loop

End If

Go to Record/Request/Page [ First ]

Loop

Set Field [ Nut_calcs::Req; Evaluate(Nut_eqs::Req) ]

Go to Record/Request/Page [ Next; Exit after last ]

End Loop

Go to Layout [ “Patient_L” (Patient) ]

Commit Records/Requests [ No dialog ]

 

2 problems:

1. I find I can only generate a 1 set of Nut_calc records per Calc record, ie. it only generate for the first IO child of Calc.

2. The evaluated result in the Nut_calc record is a repeat of the first set.

 

I'm no longer seeing wood for trees. Any clues at to what I should check?

Outcomes