How do we use the Form_BeforeClose
When you want your code to run when you are saving your data
you use the function Form_BeforeClose.
The code is running before adding data into the database.
If you want your code to run after data are added into the database,
you use the procedure Form_End.
The example below shows the basic commands.
lib
fun Form_BeforeClose()
result = 1
write your code (code for checking something or editing a record)
for example, you want to check if the value
the user enters in the field phone, has 10 digits
f = TopForm()
p = PByName(f;”CUSTOMER”)
t = TByName(p;”CUSTOMER”)
phn = TGetFlg(t;”PHONE”)
phn_l = Len(phn)
if (phn_l <> 10) then
call message(“The phone you enter is wrong. It must have 10 digits.”)
result = 0
return
endif
end