Hi Guys,
I’m new to foxpro so please forgiven my lack of understanding.
I have pieced together the following code from other processes in our system so that I can open a letter with the record set of a query and then write to a table that the letters have been sent.
It works fine if it’s run as two separate parts ie,
A sequence that runs the first process, opening the letter with a run time prompt for “Contract type”, “Contract Start Date” and “Contract End Date” and then a second process that opens the same query attached to the code for updating the fields to say that the letter has been sent.
This is working ok but I would like to join the two processes together so that I only get one run time prompt for the query.
I have tried the following process and although the letter opens fine with the required criteria the code does not update the fields (I think maybe because the query is already opened with the letters).
Does anyone know how I can do this?
Thanks in advance for any help or advice.
*!*
*!* Setup
*!*
=RunLetter("Med _Test_Query","A4","ASK")
*!*
*!* Record processing for table ACTIONS
*!*
*----+ create a blank cursor for C/S for actions as this makes it updateable
PWACreateCursor("Actions","select * from actions where 1=2")
*----+ create a blank cursor for C/S for stages as this makes it updateable
PWACreateCursor("Stages","select * from stages where 1=2")
select ACTIONS
append blank
*----+ Fill in table details
Replace Actions.action_description with "MedTest4"
Replace Actions.letter_yn with "Y"
Replace Actions.Time_Actioned with Time()
Replace Actions.Date_Actioned with Date()
Replace Actions.letter_category with "Contract"
Replace Actions.stage_code with "09"
Replace Actions.actioned_by with goVariables.cUserName
Replace Actions.stage_number with 9
replace Candidat.JnrDocContractSent with "Y"
*----+ Fill in the system fields
lnRecordID = SerialUpdate("Actions", .T.)
Replace Actions.unique_identifier with lnRecordID, ;
Actions.parent_identifier with CANDIDAT.unique_identifier, ;
Actions.datetime_created with datetime (), ;
Actions.created_by_user with goVariables.cUserName
*----+ force write back to action table
local Array laTables(4)
laTables(1)="ACTIONS"
laTables(2)="STAGES"
laTables(3)="Candidat"
laTables(4)="Vacancy"
if ! EmpowerTableUpdate(@laTables,.T.)
Warning("Action(s) could not be created")
Endif
*!*
*!* End processing for table CANDIDAT
*!*
*----+ Close Tables
PWACloseTable("Actions")
PWACloseTable("Stages")
PWACloseTable("Vacancy")
I’m new to foxpro so please forgiven my lack of understanding.
I have pieced together the following code from other processes in our system so that I can open a letter with the record set of a query and then write to a table that the letters have been sent.
It works fine if it’s run as two separate parts ie,
A sequence that runs the first process, opening the letter with a run time prompt for “Contract type”, “Contract Start Date” and “Contract End Date” and then a second process that opens the same query attached to the code for updating the fields to say that the letter has been sent.
This is working ok but I would like to join the two processes together so that I only get one run time prompt for the query.
I have tried the following process and although the letter opens fine with the required criteria the code does not update the fields (I think maybe because the query is already opened with the letters).
Does anyone know how I can do this?
Thanks in advance for any help or advice.
*!*
*!* Setup
*!*
=RunLetter("Med _Test_Query","A4","ASK")
*!*
*!* Record processing for table ACTIONS
*!*
*----+ create a blank cursor for C/S for actions as this makes it updateable
PWACreateCursor("Actions","select * from actions where 1=2")
*----+ create a blank cursor for C/S for stages as this makes it updateable
PWACreateCursor("Stages","select * from stages where 1=2")
select ACTIONS
append blank
*----+ Fill in table details
Replace Actions.action_description with "MedTest4"
Replace Actions.letter_yn with "Y"
Replace Actions.Time_Actioned with Time()
Replace Actions.Date_Actioned with Date()
Replace Actions.letter_category with "Contract"
Replace Actions.stage_code with "09"
Replace Actions.actioned_by with goVariables.cUserName
Replace Actions.stage_number with 9
replace Candidat.JnrDocContractSent with "Y"
*----+ Fill in the system fields
lnRecordID = SerialUpdate("Actions", .T.)
Replace Actions.unique_identifier with lnRecordID, ;
Actions.parent_identifier with CANDIDAT.unique_identifier, ;
Actions.datetime_created with datetime (), ;
Actions.created_by_user with goVariables.cUserName
*----+ force write back to action table
local Array laTables(4)
laTables(1)="ACTIONS"
laTables(2)="STAGES"
laTables(3)="Candidat"
laTables(4)="Vacancy"
if ! EmpowerTableUpdate(@laTables,.T.)
Warning("Action(s) could not be created")
Endif
*!*
*!* End processing for table CANDIDAT
*!*
*----+ Close Tables
PWACloseTable("Actions")
PWACloseTable("Stages")
PWACloseTable("Vacancy")