Validation

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Validation

Post by john »

Hi

I have a small problem with validation and wondered if somebody could help.

I have a business object called "Temp", these temps can fall into six different catagories which is decided by the form used to submit them (I have six different forms). Each form contains different fields from the entire field set. To achieve this I have. to start off with made all of the fields in the set non manditory. This all works fine but I would like to be able to validate the information submitted by each form.

My question
Is there a quick way that you can think of checking what information is validated by the form that was used? I have started all of these forms by a seperate process so I thought about throwing the rules into the processes, that way only the rules relevant to that process would be run each time a new temp is entered (it didnt work).

My rules in the process read
1)Enter NEW Temp USING Form1

2)If Temp IS NEW AND Temp.Name='' Then
REPORT ERROR 'You Must Enter Your Name'

Obviously this is wrong but I included it to try to explain what I am doing.

Many Thanks
John
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

John,

You can make separate objects for each purpose with a single form per object. Then you can simply mark the attributes as "Value must be provided" ane the system will do the validation automatically.

If you want to keep a single object for all purposes, you can add an attribute to indicate the intended purpose and set the attribute from a process:

Enter NEW Temp WITH Temp.Purpose = 'purpose1' USING Form1

Then you can have all necessary validation rules attached to the object:

If Temp.Purpose = 'purpose1' AND Temp.Name IS UNDEFINED Then REPORT ERROR 'You Must Enter Your Name'
Aware IM Support Team
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Post by john »

Thanks for that, I had kind of already thought of that but I realised that there will be LOTS of If statements. I suppose this is unavoidable. The reason I need the objects together is because it makes it much easier to keep all of the TempID's concurrent for each party.

I will work with your suggestion. Thanks again for your help

Regards
John
Post Reply