AnsweredAssumed Answered

Changing configuration

Question asked by tays01s on May 28, 2015
Latest reply on May 30, 2015 by tays01s

Title

Changing configuration

Post

I have some related tables

Patient < Calc::Patient_ID, Calc < IO::Calc_ID &

Config < Calc::Config_ID

Config is where I determine what appears in some valuelists downstream: Calc < IO.

So if I create a select a new Config I want a new Calc record if there isn't already one of the same date, if there is, then I want the Calc::Config_ID overwritten.

If the Calc object (portal) is empty, no problem. However, the script below creates a new Calc record without any Calc::PatientID and creates a new IO record that is related to the original Calc record.

Go to Object [ Object Name: "Config__ID" ]

Set Variable [ $Config; Value:Config::__ID ]

Go to Object [ Object Name: "calc" ]

Set Variable [ $CalcID; Value:Patient::__ID ]

Go to Layout [ “Calc” (Calc) ]

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

If [ Calc::Date_calc = Get ( CurrentDate ) ]

Set Field [ Calc::_ConfigID; $Config ]

Else

New Record/Request

Set Field [ Calc::_PatientID; $CalcID ]

Set Field [ Calc::_ConfigID; $Config ]

Go to Layout [ “Patient_L” (Patient) ]

Go to Object [ Object Name: "calc" ]

Go to Portal Row [ Select; First ]
Perform Script [ “Select Calc IO” ]

Perform Script [ “New_IO” ]

End If

Go to Layout [ “Patient_L” (Patient) ]

Go to Object [ Object Name: "calc" ]

Go to Portal Row [ Select; First ]

Outcomes