Title
Mirroring records from one portal to another
Post
I never got to the bottom of a previous post: Portals: Mirroring
In this I have the following relationships:
Drugs----<Druglist_rx>-----Prescriptions-----<Input----<Druglist_in>---Drugs|Input
I want to prescribe a DrugList_rx. When I add a new 'Input' I want to automatically generate/mirror this list in 'Druglist_in' where I can specify the actual input as opposed to what had been prescribed.
It was suggested to try:
Set Variable [ $ID; Value:Patient::Prescription_n ]
Freeze Window
Go to Layout [ “Input” (Input) ]
New Record/Request
Set Field [ Input::_PrescriptionID; $ID ]
Set Variable [ $List; Value:Druglist_rx::__DrugList_rxID ]
Go to Layout [ “Druglist_rx” (Druglist_rx) ]
Freeze Window
Loop
Set Variable [ $K; Value:ValueCount ( $K+1 ) ]
Exit Loop If [ $K>ValueCount ( $List ) ]
New Record/Request
Set Field [ Druglist_in; GetValue ( List (Druglist_rx::__DrugList_rxID) ; $K) ]
End Loop
Go to Layout [ “L_Patient Copy” (Patient) ]
Its fine till: Go to Layout [ “Druglist_rx” (Druglist_rx) ]
then gets stuck in the loop generating endless Feedlist_rx records.
Are you performing this script via a script trigger?
If so, disable that script trigger and run this script by clicking a button on your layout.
Let me know if that works. (Go to Layout is notorious for tripping any number of different script triggers on either the layout being exited or the layout being entered by the execution of that script step.)