<i><font color="#663300">Just remember to return a .T. if there is a problem with one of the data tests from the BeforeSave() method.
Did I get you correct .T. for failed and .F. for alls well cause default return value by a function is .T.
Thanks for responding.
<i><font color="#663300"><i><font color="#663300">Hi all
I have managed a purchase order form (still under works), currently there are three fields iPONo, dPODt, cPartyID (using a combo).
These three are working and are compulsory fields. In their respective builders I have check marked the respective question for making it a compulsory field. But yet I am able to save the record completely empty.
In CB terms where would you want me to put in the logic to check for empty, in the database, bo, class of the field (txt, cbo, etc), on the form </font></i> Hey Bhavbhuti, I have typically put my data checking routines in the BeforeSave method of the bizobj, with code for messageboxes to inform the user of problems as they occur. Just remember to return a .T. if there is a problem with one of the data tests from the BeforeSave() method.
</font></i>
</font></i> Yup, you heard right. If you step through the code you can see that the first operation in the save() method is a call to the beforesave() method. If the Beforesave() returns true then the line of code that is acted on is RETURN .F., which kills the save operation.
IF BeforeSave() RETURN .F. ENDIF
It is a good idea to set a breakpoint in the c-layer class method whose operation is a mystery, and step through the code to really see what the framework is doing for you in the background. Set up some watch values and see how they change and when. All the stuff in the c-layer is basically all the code you are glad you did not have to write yourself. =) It is a great learning experience. Devman mdevlin At ajdebruin D.OT com
©2001 Mike Devlin |