<i><font color="#663300">How can I find out the state of a BO on a form? By state I mean Add, Edit, Delete (just a thought) or View. I want to query the BO and it should let me know that the State is say for eg. Add, i.e. the user is currently adding a record, ditto for Edit and View.</font></i>
Bizobjs aren't really in any particular "state", although the cursors they manage certainly can be. They do have a public method IsNewAndEmpty(), which will be true just after a call to New() but before any fields have been changed. There is also the function in Utility.prg called IsAdding(), which takes an alias name as a parameter.
I've tried looking for BO properties like lAdding, lEdited but couldn't find them. I tried IsChanged() and I guess it'll suffice for Edit State. So you could also check IsAdding(bizobj.GetAlias()) to see if you are working on a new record or an existing one. <font color="#cc0000"> ___/ / __/ / ____/</font> Ed Leafe ©2002 Ed Leafe |