ok that worked well up to a point. Until I hit the inevitable 'gotcha' Created the view using the following command:
CREATE SQL VIEW LV_INVOICECODES ; AS SELECT Invcodes.client_id, Invcodes.in_date, Invcodes.cid,; Invcodes.invoice_id, Invcodes.pet_id, Invcodes.provider,; Invcodes.operator, Invcodes.item_id, Invcodes.quantity, Invcodes.charge,; Invcodes.facility, Invcodes.label, Invcodes.dose, Invcodes.committed,; Invcodes.print, Invcodes.key_item, Invcodes.createuser, InvCodes.Price,; Invcodes.createdate, Invcodes.deleteuser, Invcodes.deletedate, ; ITEM.ItemName as drugname , provider.luname AS providername, ; combos.luname as DepartmentName ; FROM vettrack!InvCodes ; JOIN vettrack!ITEM ; ON InvCodes.Item_id = ITEM.Item_id ; JOIN vettrack!provider ; ON InvCodes.provider = provider.PROV_id ; JOIN vettrack!Combos ; ON InvCodes.Facility = Combos.cid ; WHERE InvCodes.client_id = ?vp_custno
it does exactly as it should do EXCEPT it doesn't save updates. So back to adataenv.prg and add CURSORSETPROP commands
CURSORSETPROP("UpDatableFields", "cid invcode.cid", Item_id Invcodes.Item_ID .... etc.....) CURSORSETPROP("Tables","InvCodes") CURSORSETPROP("Sendupdates", .T.) - I think that last one is the wrong terminology but you get the picture.
Anyway it works fine EXCEPT Item_ID does not update. now the catch is that Item_ID relates to the first joined table. If I turn it round so Provider is the first joined table, that value is the one not saved.
Any suggestions/advice?
©2001 graeme thomson |