Smart Object Validation

Greyham

New Member
I want to validate the fields in a Visualisation. I have created a procedure in the SDO to validate the fields but when called from updateRecord procedure in the SDV the value of the rowobject.<fieldname> is not populated unless the record is already written to the database.

I would like to know.....

what code and where to put in the SDV and the SDO

I am clearly missing a trick here so any help would be greatly appreciated.

Many thanks,
Graham.

(Version 9.1D)
 
Greyham said:
I want to validate the fields in a Visualisation. I have created a procedure in the SDO to validate the fields but when called from updateRecord procedure in the SDV the value of the rowobject.<fieldname> is not populated unless the record is already written to the database.

Hello Greyham,

This isn't the "usual" way of validating data entry in ADM2. Of course, it depends on what your validation is doing. The easiest way is to use the SDO to handle all validation using the <field>validate, rowObjectValidate, and begin / pre / post / endTransactionValidate internal procedures. Then you don't need any code in your SDV at all. Just put all your validation code into one or more of the above IPs (in the SDO), and use RETURN to pass back some error message. ADM2 then handles the roll-back and messaging.

If you're looking for the fields on the rowObject record that were modified, you need to look at the RowObjUpd temp-table. This holds both "before" and "after" images of the records that have been modified. Use these :

FOR EACH rowObjUpd where rowObjUpd.rowMod = "":u:
/* original, unmodified copies of rowObject TT records */
END.

FOR EACH rowObjUpd where rowObjUpd.rowMod <> "":u:
/* new, modified TT records that will be used for database updates*/
END.


If you want to know which IPs to use, please give some examples of the validation you're aiming for and maybe I can suggest something.

Thanks,

Andy Smith.
 
Back
Top