how to validate fields

cesida

New Member
Hi
I'm working with Smart Objects on V 9.1b and I need to validate a field in two differents ways, depending on the record is being added or modified.
I read something about a field called RowObjUpd.RowMod but I don´t know how to use it .
I want to know where to put validation code and the record state.
I'm using a smart toolbar and a smart viewer to add, delete and modify a record .
Could anybody help me?

Thanks in advance.
 

cybvek

New Member
Hi!

Yes, you're right, you have to check the RowMod field.
"A" - add
"U" - modify

You have to create a preTransactionValidate procedure (you will not find in the override procedures, although the sdo calls it )
And insert your validation code to there.

To see more information, look : devtl91b/adg/adg.pdf, from page 217.

Example:

PROCEDURE preTransactionValidate :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
FOR EACH RowObjUpd WHERE RowObjUpd.RowMod = "A":U :
rowObjUpd.Type = "Test 1".
END.
FOR EACH RowObjUpd WHERE RowObjUpd.RowMod = "U":U :
rowObjUpd.Type = "Test 2".
END.
END PROCEDURE.


Regards,

Viktor

Originally posted by cesida
Hi
I'm working with Smart Objects on V 9.1b and I need to validate a field in two differents ways, depending on the record is being added or modified.
I read something about a field called RowObjUpd.RowMod but I don´t know how to use it .
I want to know where to put validation code and the record state.
I'm using a smart toolbar and a smart viewer to add, delete and modify a record .
Could anybody help me?

Thanks in advance.
 

cybvek

New Member
Ohh I missed, this procedure must be in your SDO file! :)

Originally posted by cesida
Hi
I'm working with Smart Objects on V 9.1b and I need to validate a field in two differents ways, depending on the record is being added or modified.
I read something about a field called RowObjUpd.RowMod but I don´t know how to use it .
I want to know where to put validation code and the record state.
I'm using a smart toolbar and a smart viewer to add, delete and modify a record .
Could anybody help me?

Thanks in advance.
 
Top