Tip on quick way to find current form's class library in Sage Pro

Sage Pro uses Formsets for all its MDI forms. When debugging if you want to
find out which classlibrary your form belongs to here is what you can do:
- Ensure the form you want to know is the currently selected one.
- Press Ctrl+F9 (ensure you are running from VFP and have SBTDUTIL=ON).
- In the command window give
       MESSAGEBOX( _screen.ActiveForm.Parent.ClassLibrary)
- It will show the class library the form belongs to.

Further, if you are now interested in seeing when a property changes in that
formset you can give
PUBLIC lo_FormSet
Lo_FormSet = _screen.ActiveForm.Parent

Then in the watch window you can use lo_FormSet.so_FS.sc_Sono (or whatever
property you want to track)
Note: If you use the PUBLIC lo_FormSet, you will not be able to close the
formset w/o releasing the variable. To do this, in the command window give
Release lo_formset before you try to close the form.

Regards,
- Sankaran Raman
804-364-2995
sankaran@saharti.com
www.saharti.com
http://saharti.blogspot.com/

No comments: