Field validation and value lists

Field validation and value lists

am 15.01.2008 12:31:37 von carla

I have a field, which can be based on different value lists, depending
on the context (on one layout it uses value list A, on another it uses
value list B, etc.).

My problem is how to validate it. The value in the field must be a
member of the VL that has been used, but in the field validation tab,
obviously I have to specify WHICH value list... and I can't.

Can anyone suggest an alternative approach?

Thanks,

Carla.

Re: Field validation and value lists

am 15.01.2008 14:30:39 von ursus.kirk

Carla,

I will show you how it can be done, but first of all it seems to be bad
practice to use the same field for different ValueLists. A VL normaly would
be used to store all values that would go into a field. When using more
fields, you use more VL's. When you want to use different VL's for one field
I would set up a table. Storing ALL the values then create a filter on which
the values are shown.

Now to your question. As example a file with one Table (t_Main), field (a),
two layouts (lay_one, lay_two) and two VL's (VL_one, VL_Two)

setup the validation as

PatternCount (
Case ( Get ( LayoutName ) = "lay_one" ; ValueListItems ( Get ( FileName );
"VL_One") ;
Get ( LayoutName ) = "lay_two" ; ValueListItems ( Get ( FileName );
"VL_Two") ) ;
t_Main::a )
or IsEmpty ( t_Main )

Expand as needed.

Keep well, Ursus

"Carla" schreef in bericht
news:e81212f2-ad73-4fb2-8b27-dabf69ac3e02@s13g2000prd.google groups.com...
>I have a field, which can be based on different value lists, depending
> on the context (on one layout it uses value list A, on another it uses
> value list B, etc.).
>
> My problem is how to validate it. The value in the field must be a
> member of the VL that has been used, but in the field validation tab,
> obviously I have to specify WHICH value list... and I can't.
>
> Can anyone suggest an alternative approach?
>
> Thanks,
>
> Carla.

Re: Field validation and value lists

am 15.01.2008 16:24:15 von carla

Thanks Ursus, that's really helpful.

Re. the bad practice, I think I understand what you're saying, but
they're not actually different value lists, but rather different
permutations of the SAME value list. They''re all based on the table
of "Resources". Each Resource is either a Room, or an Equipment
Item. So in one place I want to show a list of "all Rooms", and in
another I want to show a list of "Equipment Items". In yet another
place, my value list shows only "available Rooms", etc. And the way I
have it set up, they are all separate value lists, based on different
table occurrences of "Resources".

Is this any less "bad"?!

Carla.



On Jan 15, 1:30=A0pm, "Ursus" wrote:
> Carla,
>
> I will show you how it can be done, but first of all it seems to be bad
> practice to use the same field for different ValueLists. A VL normaly woul=
d
> be used to store all values that would go into a field. When using more
> fields, you use more VL's. When you want to use different VL's for one fie=
ld
> I would set up a table. Storing ALL the values then create a filter on whi=
ch
> the values are shown.
>
> Now to your question. As example a file with one Table (t_Main), field (a)=
,
> two layouts (lay_one, lay_two) and two VL's (VL_one, VL_Two)
>
> setup the validation as
>
> PatternCount (
> Case ( =A0Get ( LayoutName ) =3D "lay_one" ; ValueListItems ( Get ( FileNa=
me );
> "VL_One") ;
> Get ( LayoutName ) =3D "lay_two" ; ValueListItems ( Get ( FileName );
> "VL_Two") ) ;
> t_Main::a )
> or IsEmpty ( t_Main )
>
> Expand as needed.
>
> Keep well, Ursus
>
> "Carla" schreef in berichtnews:e81212f2-ad73-4fb=
2-8b27-dabf69ac3e02@s13g2000prd.googlegroups.com...
>
>
>
> >I have a field, which can be based on different value lists, depending
> > on the context (on one layout it uses value list A, on another it uses
> > value list B, etc.).
>
> > My problem is how to validate it. =A0The value in the field must be a
> > member of the VL that has been used, but in the field validation tab,
> > obviously I have to specify WHICH value list... and I can't.
>
> > Can anyone suggest an alternative approach?
>
> > Thanks,
>
> > Carla.- Hide quoted text -
>
> - Show quoted text -

Re: Field validation and value lists

am 15.01.2008 16:43:03 von ursus.kirk

Carla, I'm sorry to say this doesn't look to be any less bad. You have
basicaly stored two different kind of things into one field, then split it
up to be two different things again. Can't see the logic behind that, but
then again: If it works for you, don't break it.

Keep well, Ursus


"Carla" schreef in bericht
news:6f037613-42a1-4187-9533-64949aeaefde@m34g2000hsb.google groups.com...
Thanks Ursus, that's really helpful.

Re. the bad practice, I think I understand what you're saying, but
they're not actually different value lists, but rather different
permutations of the SAME value list. They''re all based on the table
of "Resources". Each Resource is either a Room, or an Equipment
Item. So in one place I want to show a list of "all Rooms", and in
another I want to show a list of "Equipment Items". In yet another
place, my value list shows only "available Rooms", etc. And the way I
have it set up, they are all separate value lists, based on different
table occurrences of "Resources".

Is this any less "bad"?!

Carla.