Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Build my own BINDEVENT for AfterInsert
Message
From
16/07/2013 17:55:27
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Build my own BINDEVENT for AfterInsert
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01578580
Message ID:
01578580
Views:
77
Hello comunity

i need to build my own custom BINDEVENT for AfterInsert. I have my table Ft (Invoice Header) and FI (Invoice Lines).
My frontend is VFP9 and my database is SQL Server.
The unique way to build the code above is to place a non visible grid because on this object i can put XBASE coding.
the object SFT.Bok1.Okbuttomdef1 is my button SAVE on my form

My custom BINDEVENT code is:

PUBLIC oHandler
oHandler = NEWOBJECT( "myhandler" )

BINDEVENT( SFT.Bok1.Okbuttomdef1, "Click", oHandler, "mymove" )

DEFINE CLASS myhandler AS Session
PROCEDURE mymove
if tableupdate(0,.T.)
messagebox("Record Save afterInsert")
endif
RETURN
ENDDEFINE

I´am not sure that my code run only when records are save on my 2 sql server tables FT and FI, or they run even if the record is not yet save.

Could someone give me an ideia and example to solve my problem ?

Many thanks
Luis Santos
Next
Reply
Map
View

Click here to load this message in the networking platform