Dave,

Like Albert, I quit using rules a while back. In my main application, work
order data is entered in 4 related tables. Data validity is controlled via
PK/FK and data entry check code. Also before the work order "status" can be
changed from "Open" to "Closed" a number of checks are made and descriptive
messages displayed as needed. Only when no errors are detected, the work
order status can be changed to Closed and other tables, such as maintenance
schedules, are updated accordingly.
Once the status is changed to Closed, no further editing is allowed; if
further updates are needed, the status must be changed back to Open and the
verification process is re-started.
This approach work very well for me.

Javier,

Javier Valencia, PE
O: 913-829-0888
H: 913-397-9605
C: 913-915-3137


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Dave McCann
Sent: Tuesday, February 21, 2012 7:37 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - EEP rule checking issue

I have a strange issue with an EEP and some rule checking I am doing.

In one particular multi-table form in my project which gets some data
pre-populated into the underlying tables, then some remaining data 
fields are edited to complete things.   I wanted the rule checking to 
occur at the end of the edit process (not when moving from table to
table) so I am turning RULES OFF and in my "Done" button EEP I set RULES ON,
do an UPDATE on the underlying data tables, trap the error and remain on the
form if there is an error.  If there are no errors, proceed to CLOSEWINDOW.
If there are no rule errors everything works fine.

The problems is if I execute the "Done" button EEP and there are rule
constraint errors, when they are corrected and the form is closed, it 
proceeds to close the forms from which this form was opened.   If I 
repeat the error condition several times, when it finally closes it'll close
several levels of forms/menus even going so far as to exit R:base or my
compiled app all the way!

Maybe my logic is flawed - when I trace the code, seems to never hit the
code AFTER my UPDATE statements when the rule validation fails and bring up
the constraint errors.  As an example, the PAUSE statements never execute if
a constraint error occurs, but they DO if there are no constraint errors.

A snippet of what I'm doing...
SET RULES ON
SET ERROR VARIABLE ev
--refresh data in table to trigger constraint check on header table UPDATE
tinvheader SET invno=(invno) WHERE invno = .vinvno SET VAR ev1=(.ev) PAUSE 2
USING 'FIRST UPDATE OK'
--refresh data in table to trigger constraint check on detail table UPDATE
tinvdetail SET billitem=(billitem) WHERE invno = .vinvno SET VAR ev2=(.ev)
PAUSE 2 USING 'SECOND UPDATE OK'
--no errors so finish up and close the form IF ev1 = 0 AND ev2 = 0 THEN
   ...do some other things
   CLOSEWINDOW
ENDIF
RETURN

Any ideas?


--
Dave McCann
Classic Micro Systems

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: 
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, 
place any 
text to search for.
================================================


Reply via email to