on 12-05-2005 3:40 PM
Hi,
I have an employee table (with columns empno, empname) in MDM. I specified a contraint/validation for MDM column empno that empno should accept only 3 digits. This validation is working perfectly when I add records through MDM client.
But the same is not working when I use to add records using Java api. Think the method is bypassing the validation and accepting records with less than 3 digits also.
Do any one have idea how can I restrict using java api?
Thanks for your time and help.
Thanks & Regards,
Shiva Kumar.
Two ideas, which might help :
1) What did you enter for the flag "Automatic execution" for the validation ? None, Warning or Error ? Maybe it helps. when this flag is set to error.
2) The class "ValidateRecordsCommand" can be used to validate records againt a validation. The class "ValidationFailure" can be used to retrieve info about records, that failed the validation.
Regards Klaus
Regards Klaus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shiva,
I did notice the same. It will bypass the validation and adds the record to the repository. Even if you follow the option 1 given by Klaus David.
I would suggest the following way. Its a work around.
1. Use CatalogData's AddRecord Method.
2. Get the record Id for the record you added.
3. Use the CatalogData's CreateValidateRecordsCommand method to get the ValidateRecordsCommand Object.
4. Use the ValidateRecordsCommand object to set the values using the following methods.
SetTable,SetRecordIDs.
5. Use ValidateRecordsCommand's GetValidationFailures method to get the ValidationFailures object.
6. Use ValidationFailures GetRecordIDs methd to get the validation failed record ids.
7. Match the initial added record id with the record id's.
8. Delete the records using the CatalogData's DeleteRecords method by passing the record ids.
Thanks and Regards
Subbu
Hi All,
I have 3 chars width column in my table and user is sending 10 chars to insert. It is trancating to 3 chars and inserting it to database.
If I use the methodology u mentioned above,first it will add it to the database and check for failures.
Can u explain me clearly how it will validate in the above case.
Shiva,
Try to execute the validation using the API.
Regards,
Rajani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.