Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save() an empty view
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Save() an empty view
Miscellaneous
Thread ID:
00345629
Message ID:
00345629
Views:
38
I've run into an issue (or is it an issue?) with the Save() method on an empty cursor. I've made the change to SetPrimaryKeyFieldState() that came up a few weeks back.

Here's the scenario:

I've got a form that has a grid. The grid is populated with a list of products in the row, and each day of the week for each column.

Products Mon Tue Wed Thu Fri
----------------------------------

The primary bizobj on this form uses a table-buffered view "v_Order" . The grid however is based on a dummy view (non-updating) that matches the grid format. When the form activates I populate this dummy view with the products, then loop through them adding in any orders (in the orders table) that are there. Works just fine.

There are also a "Previous" and "Next" button that lets the user move between weeks. In them I call a Save() to make sure any changed info gets saved. Essentially all I do is loop through dummy view and add/update any changes to v_order. Then I call the bizobj's Save() method. The bizobj has lSaveAllRows set .T. .

Since I'm just testing it right now, there aren't any records in the v_order view.

In the Save() method it's erroring out as with a "table buffer for v_order contains uncommitted changes". When I trace through it I notice in the cTableBehavior.Save() SCAN loop, it's making one call to SetPrimaryKeyFieldState(), which then changes the empty record. Is this a bug or am I just misunderstanding what should be happening?
-Paul

RCS Solutions, Inc.
Blog
Twitter
Next
Reply
Map
View

Click here to load this message in the networking platform