I've encountered a situation which I find quite puzzling. I may need to create a smaller workspace that can reproduce the problem, but since that is probably a lot of work, let me describe the situation first:

I am testing some order entry scenarios for our application (not the order entry example that's provided with DataFlex Studio, although perhaps the same problem could be shown there). I have everything automated, even simulating the pressing of keys. Before every test run, I am running a script to restore the database (it takes only a second). Then a few order entry scenarios are running. After every scenario, I run a SQL script to delete the orders that have been created. And here is where the problem occurs. Presumably, if I delete the orders using dataflex commands, it would be ok. But when I do it using SQL statements, DataFlex gets confused.

So after the SQL delete statements, when the next order entry scenario is happening, when the order detail has been entered and the program tries to save, the save fails, with a "record not found" error.

I have tried to send "clear" messages to help DataFlex understand that there is no active record. But so far I have not been successful.

Has anyone seen anything like this? Is there a way to tell DataFlex that the database has been "reset", so all DataDictionary objects and global database buffers are regarded as empty?