Hello,
From a few tweeks on the Alpha5 Invoice entry, I made a cansave event. When I just have one condition with a UI Message Box, it works ok. However, if I add another if Statement to check, it only executes the first condition if True, and not the other. I also tried this in the CANSAVE record event, and it behaves the same way.
Here's the Code:
Thanks,
Ryland
From a few tweeks on the Alpha5 Invoice entry, I made a cansave event. When I just have one condition with a UI Message Box, it works ok. However, if I add another if Statement to check, it only executes the first condition if True, and not the other. I also tried this in the CANSAVE record event, and it behaves the same way.
Here's the Code:
'Date Created: 19-Jun-2009 10:56:25 AM
'Last Updated: 19-Jun-2009 10:56:25 AM
'Created By : Ryland
'Updated By : Ryland
'Open the table that you want to update...
dim tbl as p
DIM xyz as C = ""
DIM varC_result as C = ""
DIM rpt as N = 1
dim itbl as p
dim key_expr as c
dim key_value as c
dim data_type as c
tbl = table.open("product",FILE_RW_SHARED)
'Set the table order to the key expression
if tbl.Next_calibration_date < date()then
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Tool Calibraion Overdue",<<%dlg%
{region}
Tool Calibration is Overdue...Prese OK to Continue Issuing Tool.
{endregion};;
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};%dlg%,<<%code%
if a_dlg_button = "OK" then
ui_modeless_dlg_close("Tool Calibraion Overdue")
close_if_exists("Tool Calibraion Overdue")
tbl.close()
end if
if a_dlg_button = "CANCEL" then
'do nothing, let the dialog close
cancel()
tbl.close()
end if
%code%)
end
end if
if tbl.Next_service_date < date()then
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Tool Service Overdue",<<%dlg%
{region}
Tool Service is Overdue...Prese OK to Continue Issuing Tool.
{endregion};;
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};%dlg%,<<%code%
if a_dlg_button = "OK" then
ui_modeless_dlg_close("Tool Service Overdue")
close_if_exists("Tool Service Overdue")
tbl.close()
end if
if a_dlg_button = "CANCEL" then
'do nothing, let the dialog close
cancel()
tbl.close()
end if
%code%)
end
end if
Has anyone else seen this behavior ??'Last Updated: 19-Jun-2009 10:56:25 AM
'Created By : Ryland
'Updated By : Ryland
'Open the table that you want to update...
dim tbl as p
DIM xyz as C = ""
DIM varC_result as C = ""
DIM rpt as N = 1
dim itbl as p
dim key_expr as c
dim key_value as c
dim data_type as c
tbl = table.open("product",FILE_RW_SHARED)
'Set the table order to the key expression
if tbl.Next_calibration_date < date()then
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Tool Calibraion Overdue",<<%dlg%
{region}
Tool Calibration is Overdue...Prese OK to Continue Issuing Tool.
{endregion};;
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};%dlg%,<<%code%
if a_dlg_button = "OK" then
ui_modeless_dlg_close("Tool Calibraion Overdue")
close_if_exists("Tool Calibraion Overdue")
tbl.close()
end if
if a_dlg_button = "CANCEL" then
'do nothing, let the dialog close
cancel()
tbl.close()
end if
%code%)
end
end if
if tbl.Next_service_date < date()then
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Tool Service Overdue",<<%dlg%
{region}
Tool Service is Overdue...Prese OK to Continue Issuing Tool.
{endregion};;
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};%dlg%,<<%code%
if a_dlg_button = "OK" then
ui_modeless_dlg_close("Tool Service Overdue")
close_if_exists("Tool Service Overdue")
tbl.close()
end if
if a_dlg_button = "CANCEL" then
'do nothing, let the dialog close
cancel()
tbl.close()
end if
%code%)
end
end if
Thanks,
Ryland
Comment