Hi,
I have a form and a problem
Form is tied to a Sql view
View is generated with following command
set multilocks on
Create sql view patsient_view connection abihaigla share;
as select * from patsient where patsient.id=(?_isikid)
dbsetprop('patsient_view', 'View', 'Tables', 'patsient')
dbsetprop('patsient_view.id','Field', 'Keyfield', .T.)
dbsetprop'patsient_view.id', 'Field', 'Updatename', 'patsient.id')
dbsetprop('patsient_view.id', 'Field', 'Updatable', .t.)
dbsetprop('patsient_view', 'View', 'Sendupdates', .t.)
Use patsient_view in 0
select patsient_view
CURSORSETPROP("Buffering", 5, "patsient_view")
When I run two instances of that form and load same record from "patseint" table into view and on one form delete that record and on another one change something in that record and save it I get no update conflict error. That error appears only when I change and save record on form one and then change and save record on form two.
Saving code is following:
Select patsient_view
patsnext=GETNEXTMODIFIED(0)
If (patsnext=0)
Select patsient_view
Requery()
This.parent.refresh
Else
If !tableupdate(.t.)
vastusmsg=MessageBox([Another user has changed data, do you wanna save your changes?],4,"Error")
If vastusmsg=7
Select patsient_view
Tablerevert()
This.parent.refresh
Endif
If vastusmsg= 6
Select patsient_view
public tableups
=Tableupdate(2, .t., "patsient_view", errorarr)
Endif
Endif
Endif
Thank for you time!
I have a form and a problem

Form is tied to a Sql view
View is generated with following command
set multilocks on
Create sql view patsient_view connection abihaigla share;
as select * from patsient where patsient.id=(?_isikid)
dbsetprop('patsient_view', 'View', 'Tables', 'patsient')
dbsetprop('patsient_view.id','Field', 'Keyfield', .T.)
dbsetprop'patsient_view.id', 'Field', 'Updatename', 'patsient.id')
dbsetprop('patsient_view.id', 'Field', 'Updatable', .t.)
dbsetprop('patsient_view', 'View', 'Sendupdates', .t.)
Use patsient_view in 0
select patsient_view
CURSORSETPROP("Buffering", 5, "patsient_view")
When I run two instances of that form and load same record from "patseint" table into view and on one form delete that record and on another one change something in that record and save it I get no update conflict error. That error appears only when I change and save record on form one and then change and save record on form two.
Saving code is following:
Select patsient_view
patsnext=GETNEXTMODIFIED(0)
If (patsnext=0)
Select patsient_view
Requery()
This.parent.refresh
Else
If !tableupdate(.t.)
vastusmsg=MessageBox([Another user has changed data, do you wanna save your changes?],4,"Error")
If vastusmsg=7
Select patsient_view
Tablerevert()
This.parent.refresh
Endif
If vastusmsg= 6
Select patsient_view
public tableups
=Tableupdate(2, .t., "patsient_view", errorarr)
Endif
Endif
Endif
Thank for you time!