Hi guys,
I have a problem with my software of Alpha Five V11 when I try to use an operation that I created .
This operation is an Update to a table with a variable at runtime of the current year ( see the script ). When I try to use this script I can update the table , but if I try to use another time the same script I receive a popup error as you see on the pictures attached, and I check the table the field is updated with this new value .
'Date Created: 14-Feb-2013 04:29:26 PM
'Last Updated: 14-Feb-2013 04:29:26 PM
'Created By : Notebool
'Updated By : Notebool
'Operation is based on current filter and order of current table.
'Get the current table's filter and order expression
dim mru as p
mru = mru_query("tbl_fatturatoclienti")
current_filter = mru.filter
current_order = mru.order
current_flags = mru.flags
'Check to see if current filter/order is valid in the context of "tbl_fatturatoclienti"
if current_filter <> "" then
if eval_valid(current_filter,"tbl_fatturatoclienti") =.f. then
a5_Operation_Warning() 'Display warning if current selection is meaningless
current_filter = ".t."
end if
end if
if current_order <> "" then
if eval_valid(current_order,"tbl_fatturatoclienti") = .f. then
current_order = ""
end if
end if
'Prompt for any ASK variables in filter/order expressions......
ask_vars = <<%list%
Askn_Anno_Di_Pertinenza
%list%
prompt_result = a5_prompt_for_ask_vars(ask_vars,session_variables(session_get()))
if prompt_result <> "OK" then
end
end if
a_tbl = table.open("tbl_fatturatoclienti")
ON ERROR GOTO ERROR14022013162857402
DIM a5_operation_filter as C
a5_operation_filter = current_filter
query.filter = a5_operation_filter
DIM a5_operation_order as C
a5_operation_order = current_order
query.order = a5_operation_order
query.options = "I"+current_flags
query.description = "Temporary Query"
a_tbl.query_create("N")
update.fields = 1
update.field1 = "ANNO"
update.expr1 = "Var->askN_Anno_di_pertinenza"
a_tbl.update()
GOTO CONTINUE14022013162857402
ERROR14022013162857402:
ON ERROR GOTO 0
ui_msg_box("Error","Error running Update Operation"+crlf()+error_text_get())
END
CONTINUE14022013162857402:
a_tbl.close()'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
Attached you can findalso the dbf files
I would be grateful if someone would tell me what kind of error is this
I have a problem with my software of Alpha Five V11 when I try to use an operation that I created .
This operation is an Update to a table with a variable at runtime of the current year ( see the script ). When I try to use this script I can update the table , but if I try to use another time the same script I receive a popup error as you see on the pictures attached, and I check the table the field is updated with this new value .
'Date Created: 14-Feb-2013 04:29:26 PM
'Last Updated: 14-Feb-2013 04:29:26 PM
'Created By : Notebool
'Updated By : Notebool
'Operation is based on current filter and order of current table.
'Get the current table's filter and order expression
dim mru as p
mru = mru_query("tbl_fatturatoclienti")
current_filter = mru.filter
current_order = mru.order
current_flags = mru.flags
'Check to see if current filter/order is valid in the context of "tbl_fatturatoclienti"
if current_filter <> "" then
if eval_valid(current_filter,"tbl_fatturatoclienti") =.f. then
a5_Operation_Warning() 'Display warning if current selection is meaningless
current_filter = ".t."
end if
end if
if current_order <> "" then
if eval_valid(current_order,"tbl_fatturatoclienti") = .f. then
current_order = ""
end if
end if
'Prompt for any ASK variables in filter/order expressions......
ask_vars = <<%list%
Askn_Anno_Di_Pertinenza
%list%
prompt_result = a5_prompt_for_ask_vars(ask_vars,session_variables(session_get()))
if prompt_result <> "OK" then
end
end if
a_tbl = table.open("tbl_fatturatoclienti")
ON ERROR GOTO ERROR14022013162857402
DIM a5_operation_filter as C
a5_operation_filter = current_filter
query.filter = a5_operation_filter
DIM a5_operation_order as C
a5_operation_order = current_order
query.order = a5_operation_order
query.options = "I"+current_flags
query.description = "Temporary Query"
a_tbl.query_create("N")
update.fields = 1
update.field1 = "ANNO"
update.expr1 = "Var->askN_Anno_di_pertinenza"
a_tbl.update()
GOTO CONTINUE14022013162857402
ERROR14022013162857402:
ON ERROR GOTO 0
ui_msg_box("Error","Error running Update Operation"+crlf()+error_text_get())
END
CONTINUE14022013162857402:
a_tbl.close()'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
Attached you can findalso the dbf files
I would be grateful if someone would tell me what kind of error is this
Comment