Jump to content

Repeating fields validation


This topic is 6976 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi guys,

I have a repeating field called Type with a repition of 3 i also have another repeating field called sub_type with a repition of 3 both on the same layout.

Now what im getting stuck on is :

1 i obviously dont want any of the repeating types to repeat themsleves Example

Type (proper validation)

dog

cat

mouse

type (Should tip validation calculation)

dog

dog

mouse

if the user picks dogs twice i want it to revert back to blank until he/she picks something that doesnt repeat dog.

2. If the user picks dog for the first repition of type (type[0]) i was wondering could i manuplate the pop munu that appears for sub_type (sub_type[0]).

Something like (sudocode)

if type[0] = "dogs" then sub_type[0] popmenu = dogs popup menu

if type[0] = "cats" then sub_type[0] popmenu = cats popup menu

if type[0] = "mouse" then sub_type[0] popmenu = mouse popup menu

Any assistance/pointers/ridicule weclome.

D

Link to comment
Share on other sites

Repeating fields are not useful here. You have a limited number of animal choices (apparently only 3), so a valuelist would be appropriate. Then, based on the choice of animal you could pop-up another valuelist by using the valuelistitems function. Predefine all of the possible valuelists, then use the Case function based on animal to display the appropriate valuelist.

Link to comment
Share on other sites

Hi transpower and thanks for the reply however there are more than 3 animals there are 10. I cannot change it from a repeating field as it is central the entire solution and i do not have time time to overhaul, so Is there a way to validate repeating field elements?

I am currently looking into the valuelistitem function.

Yet again thanks for your time.

D

Link to comment
Share on other sites

Validation by calculation: (Rep[1] <> Rep[2]) and (Rep[1] <> Rep[3]) and (Rep[2] <> Rep[3])for three repetitions.

For more repetitions and with Developer, you could write a custom recursive function, starting with the last non-blank repetition and checking to see if it equals any previous repetition, recursing for the next to the last non-blank repetition, etc. Like I said, portals would be easier.

Link to comment
Share on other sites

Or create a value list based on the repeating field, using a relationship from serial to serial, and validate that ValueCount(ValueListItems( Get(FileName); "yourValueList" )) = Count(repeatingfield). You may have to do this in a separate field so that the value list is updated before the validation occurs.

Link to comment
Share on other sites

This topic is 6976 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.