AnsweredAssumed Answered

Script failure

Question asked by tays01s on Jul 2, 2014
Latest reply on Jul 10, 2014 by philmodjunk

Title

Script failure

Post

     I have a series of parent child portals whose records are created/ deleted from scripted buttons. This all works fine until I delete all records from all tables except Patient. I then find that the scripts (eg below) instead of creating a new record within the portal, instead create a new patient.

     Relationships: Patient < Calc < Prescription. I have NOT activated create/delete via the relationships because I want everything to work via the scripts.

Perform Script [ “Allow user abort” ]

Freeze Window
                    Go to Object
[ Object Name: "calc" ] If [ not IsEmpty (Calc::_PatientID) ]

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

Go to Record/Request/Page [ Last ]
Duplicate Record/Request

Else
                    Set Variable
[ $ID; Value:Patient::__PatientID ]

Go to Layout [ “Calc” (Calc) ]
New Record/Request
                    Set Field
[ Calc::_PatientID; $ID ]

End If

Go to Layout [ “L_Patient Copy” (Patient) ]

Go to Object [ Object Name: "calc" ]

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

Perform Script [ “New_prescription” ]

      

Outcomes