Luc,
Try the following;
Make sure you have defined the following expression:
vconsult = consultnummer
Then put the following code in the "consult" table AFTER INSERT eep
UPDATE consult SET studyuid = ('31055' + (FORMAT(.#now,'DDMMYYYYHHNNSS'))) +
WHERE consultnummer = .vconsult
RETURN
EEP's can only pass information in variables. Hence the need for the first
expression.
Note the simplified code. You can nest functions. Also, FORMAT functions
always returns a TEXT value
and it does not affect date and time format so you don't need the SET FORMAT
lines.
I am not sure why you have to first INSERT the row before you can determine and
UPDATE the studyid.
It would seem that using appropriate PROPERTY commands you could set this value
in a table BEFORE INSERT eep.
Jim Bentley
American Celiac Society
[email protected]
tel: 1-504-737-3293
________________________________
From: Luc Delcoigne <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Sat, July 31, 2010 4:22:13 AM
Subject: [RBASE-L] - re: can't update row
Hi,
On creating a new consultation I have to insert a StudyUID in the row after it
is saved.
I'm trying to do this by running a stored procedure in the "on close " EEP:
SAVEROW
SET VAR vdatetime= (FORMAT(.#now,'DDMMYYYYHHNNSS'))
SET VAR vdate TEXT =(CTXT(.vdatetime))
SET VAR vstudyuid TEXT = .vdate
SET VAR vstudyuid TEXT = (SGET(.vdate,14, 1))
SET VAR vstudyuid TEXT = ('31055' + .vstudyuid)
UPDATE consult SET studyuid = .vstudyuid WHERE consultnummer = .vconsult
SET DATE FORMAT DD/MM/YYYY
SET TIME FORMAT HH:MM:SS
RETURN
The problem is that this doesn't work when I close the form the first time
after creating the consultation.
When I return to this form a second time and close it, then it runs as it
should and the studyUID is saved to the row.
I tried everything I could think of (after saving row, after inserting row EEP
on the table....)
What am I missing here ?
Luc Delcoigne