Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table buffering error
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00577587
Message ID:
00578165
Views:
29
>>>>>
>>>>>Tom, I'd love to show you the code, but I don't know how to show all the code or know what is important to show. I doubt if you want to see everything. There is code in 7 procedures for the form object itself.
>>>>>(Init, Show, Unload, displayfields, loaddefauts, showbuttons, validatefields)
>>>>>The little bit of code I have pasted have been from the MyCmdSave Object, Click Procedure. Tell me what to show you and you got it. Thanks
>>>>
>>>>Ken;
>>>>
>>>>Show the code you are using to save, and replace the value in the products table.
>>>>
>>>>Tom
>>>
>>>Now I'm really going to look ignorant. I thought "replace" replaced and saved the changes. I've never added "Save" to any of this code ever and "Replace" has always replaced. But, in those instances the opening and saving I guess was already being handled and I was just doing the replacing in between.
>>>
>>>The original code for this save button has several replaces that the creator put in the procedure that seem to work. But, none for the Product file.
>>>Just after my code is only:
>>>
>>>If DoDefault() = .T. Then
>>>	ThisForm.DontLoadDetails = .F.
>>>	ThisForm.DisplayFields
>>>Else
>>>	ThisForm.DontLoadDetails = llOrigDontLoadDetails
>>>EndIf
>>>
>>>
>>>I have searched "All objects" for "Save" and do not see the command anywhere on this form. Is that abnormal?
>>
>>Ken;
>>
>>Save is a term refering to a method that will use TableUpdate() if you are using buffering. In this case I mean after you save the original work (invoice) you update the products table.
>>
>>Just an update of the code you are using now compared to your original post is what I need.
>>
>>Tom
>
>The code now is:
>
>set deleted on
>Select * from InvoiceDetail Where Invoice_ID = InvoiceHeader.Invoice_ID ;
>    into cursor InvLinesCursor
>scan   && we are scanning invLinesCursor, not invoiceDetail table
>    if indexseek(InvLinesCursor.Product_ID, .t., 'product', 'product_id')
>        * product found
>        CursorSetProp("Buffering", 5, "Product")
>        select product
>        Replace UseSeason with m.currentseason
>    else
>        * product not found...error processing here
>        * referential integrity is supposed to prevent this
>    endif
>endscan
>
>
>This is based on Steve's earlier reply. I know this is different than what you sent me. Even though the code you sent was shorter I kinda understood what his code was doing better. I can try what you sent earlier, but does Steve's code make sense.


Ken;

Let's try this.
set deleted on
Select * from InvoiceDetail Where Invoice_ID = InvoiceHeader.Invoice_ID;
    into cursor InvLinesCursor
scan   && we are scanning invLinesCursor, not invoiceDetail table
    if indexseek(InvLinesCursor.Product_ID, .t., 'product', 'product_id')
        * product found
        select product
	CursorSetProp("Buffering", 5, "Product")
        Replace Product.UseSeason with m.currentseason
    else
        * product not found...error processing here
        * referential integrity is supposed to prevent this
    endif
endscan
Let me know how it goes.

Tom
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform