View data not updating

Author: Chester Friesen

Posted: 2004-07-11 at 22:04:44

I am having trouble saving data from a view. I have bizobj's invoice,

invoiceline and lineitems involved. The invoice and invoiceline data

saves perfect. If I suspend the program and look at the view, the data

is written correctly, but will not save to the table. The view

settings are all set to update. Here is some test code I am trying,

this is called from the invoicelinebizobj.beforesave:

* AdjustInventory

* Called from ainvoiceline.beforesave()

SELECT v_invoiceline

SCAN

SELECT v_lineitems

LOCATE FOR v_lineitems.iid=v_invoiceline.ITEMID

IF v_invoiceline.backorder

*do replacements here

WAIT WINDOW "A BACKORDER"

WAIT WINDOW ALIAS()

REPLACE v_lineitems.comments WITH "A BACKORDER"

ELSE

*do replacements here for qty, etc. (eventually)

WAIT WINDOW "NOT BACKORDER"

WAIT WINDOW ALIAS()+" " + bookname

REPLACE comments WITH "NOT BACKORDER"

WAIT WINDOW "Comments="+ v_lineitems.comments

ENDIF

ENDSCAN

RETURN

The wait windows are for testing only, they all show that it is

working with no errors. I inserted a suspend after the "replace

comments", the v_lineitems showed the data was written into the right

field.

There is probably something simple that I am not thinking of, but I

have gone through every setting I know.

I need some ideas, either how to debug, or settings to check.

TIA,

©2004 Chester Friesen