I am trying to set up a new grid. When I work in live preview, before it has even been published, working here on my own computer all by myself, the program will not let me change a previously save record. I get the following message:
Row Number Xbasic Code
3 'NOTE: a_xbasic_i is the "i'th" entry in the rtc.a_xbasic_work[] array
on error goto errorFindingRecord
dim i_tbl as p
i_tbl = tbl_member_unique_data.query_create("",replace_arguments_in_string("recno() = :Primary__Key__Value",args))
if i_tbl.records_get() = 0 then
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = "Record to update not found. It is possible that another user has deleted this record."
end
else if i_tbl.records_get() > 1 then
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = "Record was not updated because more than one record matches the primary key value for this record."
end
end if
DIM flagWriteConflict as L = .f.
dim a_xbasic_i.conflicts[0] as p
a_xbasic_i.conflicts.resize(0)
if .not.(tbl_member_unique_data.data("place_of_birth") = args[args.ArgumentNumber("Old_PLACE_OF_BIRTH")].data) then
flagWriteConflict = .t.
a_xbasic_i.conflicts[].field_name = "Place_of_birth"
a_xbasic_i.conflicts[..].currentValueInTable = (tbl_member_unique_data.data("place_of_birth"))
a_xbasic_i.conflicts[..].ValueWhenUserStartedEditing = args[args.ArgumentNumber("Old_PLACE_OF_BIRTH")].data
end if
if flagWriteConflict = .t. then
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = a5gridHelper_showWriteConflicts_HTML(a_Xbasic_i.conflicts, tmpl, rtc, rv, __si )
end
end if
on error goto errorUpdatingRecord
Delete Rmember_unique_data
DIM Rmember_unique_data as P
Rmember_unique_data.place_of_birth = args[args.ArgumentNumber("New_PLACE_OF_BIRTH")].data
errors_member_unique_data = tbl_member_unique_data.change_record(Rmember_unique_data)
if errors_member_unique_data.has_errors = .t. then
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = ""
dim a_err as p
a_err = rtc.a_fieldValidationErrors
a5GridHelper_ProcessFieldRulesErrors(a_err, errors_member_unique_data, "1" )
else
a_xbasic_i.hasError = .f.
a_xbasic_i.errorText = ""
end if
end
errorUpdatingRecord:
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = "Error updating record. Error reported was: " + error_text_get()
end
errorFindingRecord:
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = "Error finding record to update. Error reported was: " + error_text_get()
end
:new_place_of_birth (C) Fairborn, Ohio
:old_place_of_birth (C)
:primary__key__value (N)
Row Number Xbasic Code
3 'NOTE: a_xbasic_i is the "i'th" entry in the rtc.a_xbasic_work[] array
on error goto errorFindingRecord
dim i_tbl as p
i_tbl = tbl_member_unique_data.query_create("",replace_arguments_in_string("recno() = :Primary__Key__Value",args))
if i_tbl.records_get() = 0 then
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = "Record to update not found. It is possible that another user has deleted this record."
end
else if i_tbl.records_get() > 1 then
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = "Record was not updated because more than one record matches the primary key value for this record."
end
end if
DIM flagWriteConflict as L = .f.
dim a_xbasic_i.conflicts[0] as p
a_xbasic_i.conflicts.resize(0)
if .not.(tbl_member_unique_data.data("place_of_birth") = args[args.ArgumentNumber("Old_PLACE_OF_BIRTH")].data) then
flagWriteConflict = .t.
a_xbasic_i.conflicts[].field_name = "Place_of_birth"
a_xbasic_i.conflicts[..].currentValueInTable = (tbl_member_unique_data.data("place_of_birth"))
a_xbasic_i.conflicts[..].ValueWhenUserStartedEditing = args[args.ArgumentNumber("Old_PLACE_OF_BIRTH")].data
end if
if flagWriteConflict = .t. then
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = a5gridHelper_showWriteConflicts_HTML(a_Xbasic_i.conflicts, tmpl, rtc, rv, __si )
end
end if
on error goto errorUpdatingRecord
Delete Rmember_unique_data
DIM Rmember_unique_data as P
Rmember_unique_data.place_of_birth = args[args.ArgumentNumber("New_PLACE_OF_BIRTH")].data
errors_member_unique_data = tbl_member_unique_data.change_record(Rmember_unique_data)
if errors_member_unique_data.has_errors = .t. then
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = ""
dim a_err as p
a_err = rtc.a_fieldValidationErrors
a5GridHelper_ProcessFieldRulesErrors(a_err, errors_member_unique_data, "1" )
else
a_xbasic_i.hasError = .f.
a_xbasic_i.errorText = ""
end if
end
errorUpdatingRecord:
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = "Error updating record. Error reported was: " + error_text_get()
end
errorFindingRecord:
a_xbasic_i.hasError = .t.
a_xbasic_i.errorText = "Error finding record to update. Error reported was: " + error_text_get()
end
:new_place_of_birth (C) Fairborn, Ohio
:old_place_of_birth (C)
:primary__key__value (N)