P
Peter Judge
Guest
1) Where do I place the validations? Inside the class.method I'm working? The Business Entity is the right place to do data validation. Many people do validation in the BE and I know of some who have "validation providers" that don't care about the BE but simply work on a set of data. What you use depends on your application design. I'd start with in-BE though, since its simplest. 2) Do I place it before or after the SUPER? Depends on what you're trying to do/prevent. Validating BEFORE the super means that you do stuff before the standard behaviour kicks in. This is where I'd do most validations for updates. Code after the SUPER means after the standard behaviour. For reads I'd add code here to do aggregrations or similar. (Is there anyplace where I can check the code of the businessEntity?) It's shipped in $DLC/src/OpenEdge.BusinessLogic.pl. You will have to use a tool to extract the code from there (best tool for this kind of job is PCT IMO, but there are also standalone tools in the box in $DLC/src/extractpl.bat). 3) How can I return the error? is it with the AppError? for example: There are attributes (properties) related to ProDataSets that allow you to add error context and have those be returned. There's doc at documentation.progress.com/.../setting-and-using-error,-error-string,-and-rejec.html These are primarily string/character fields and you can put whatever you want into them. If you want them to contain "better" or "nicer" errors then I'd suggest using a stringified JSON format. We suggest (for Rollbase, which consumes this data too) something like The JSON object has the following properties msg (mandatory) A string containing the message text. field (optional) A value representing the field that this message applies to tbl (optional) A value representing the the table this message applies to id (optional) A value representing the record/row this message applies to You have no control over what information is returned for "real" system exceptions . 4) And how do i cath/show this error in kendo grid? Edsel will have to chime in here 
Continue reading...
Continue reading...