Thanks again for your ongoing help with this. Now I have a portal to CalDailyApptRx's on one of the tabs in my MiniWindow Edit Appt layout. I have inserted a "modify" button that, when clicked, executes a script that I want to do the following:
1) duplicate the selected Rx record
2) set the StopDate of the selected Rx record to today (in other words, stopping this Rx)
3) go to the newly created Rx record and set its StartDate to today (in other words, initiating this new Rx as of today)
4) insert the cursor in the "Dose" field (because I am now going to change the dose of the Rx)
Here's the script I wrote. Needless to say -- it doesn't work(!)
--
- Code: Select all
Set Variable [ $ContactID; Value:CalDailyAppointments::ApptContactID_kf ]
Set Variable [ $ApptDate; Value:CalDailyAppointments::ApptDateStart_k ]
Set Variable [ $ApptID; Value:CalDailyAppointments::ApptID_kprime ]
Set Variable [ $RxNumID; Value:CalDailyContactRx's::RxIDNumber_kf ]
Perform Script [ “Set field depending on tab selected, and Continue Script by Jim 09-16-06” ]
#Insert if statements here, if desired, to trap potential errors or problems (e.g. entering new Rx into an appointment greater than 10 days old).
Go to Related Record [ From table: “CalDailyContactRx's”; Using layout: “Patient Rx's” (ContactRx's) ]
[ Show only related records ]
View As
[ View as Form ]
Set Field [ CalDailyContactRx's::RxStopDate; Get ( CurrentDate ) ]
Duplicate Record/Request
Set Field [ CalDailyExContactRx's::RxStartDate; Get ( CurrentDate ) ]
Clear [ CalDailyContactRx's::RxStopDate ]
[ Select ]
Go to Field [ CalDailyContactRx's::RxDose ]
Pause/Resume Script [ Indefinitely ]
Go to Layout [ original layout ]
Perform Script [ “Go to tab corresponding to appointment type” ]
#Go to the 1st portal row.
Go to Portal Row [ Select; First ]
--
Can you help me figure out where I went wrong?
Yours,
Jim R.