Link to home
Start Free TrialLog in
Avatar of kalios
kalios

asked on

Formula Question....

Hi...Have two fields in a form A1 & A2.

both the fields can store multiple values in it. each value is 13 bytes long.

Now I've to put a validation so that no duplicates can be entered.
In A1's input translation I've @Unique(A1)
In A2's input translation I've @Unique(A2)  

But i also want to restrict this. If a value in in A1 and the same value is in A2. it should give an error message.

I did put the following in A2's input validation.
@If(a2 = a1;@Failure("cannot enter duplicates");@Success)...

But this works only for some values.(Not sure why... may be becuase A1 and A2 are multi-value fields)

thanks
Kalios
Avatar of HemanthaKumar
HemanthaKumar

use

@If(a2 *= a1;@Failure("cannot enter duplicates");@Success)...

~Hemanth
Avatar of kalios

ASKER

great so *= is the trick..

Hemanth, is there a way to show the duplicate in the error message.

thanks
There is..
Avatar of kalios

ASKER

How?
Avatar of kalios

ASKER

sorry, i've no more points left. i'll have to buy them. i'll for my next question.
Kalios
Use @keywords

Partha
ASKER CERTIFIED SOLUTION
Avatar of HemanthaKumar
HemanthaKumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Neat, been a while since I saw that one.  Ah, the joys of list processing.
Avatar of kalios

ASKER

I can just say ONLY one thing..

SUPER HEMANTH - If I could increase the font size I would do it to the biggest.

thanks
Kalios
Avatar of kalios

ASKER

It returns all the duplicates. I've used  num*+ num*+ num*+ num  as i've more values here.

also, once I save the document it displays me all the duplicates which is great. but i also want this.
once i click ok on the message all the duplicates should be removed from A2.


thanks
Kalios.
Avatar of kalios

ASKER

Hemanth, I get the list of all the duplicates as return which is great. is it possible to remove duplicates from A2 by using formula or do i have to write a script for that.
Avatar of kalios

ASKER

ok i get it...

a := @Replace(A2;fieldwhereistoredduplicatesfromyourcode;"");
@If(fieldwhereistoredduplicatesfromyourcode = a2; @SetField("a2";a) ;"");
@Command([ViewRefreshFields])

this works fine.... can i do any better.
kalios
You are good with the code