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
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
ASKER
great so *= is the trick..
Hemanth, is there a way to show the duplicate in the error message.
thanks
Hemanth, is there a way to show the duplicate in the error message.
thanks
There is..
ASKER
How?
ASKER
sorry, i've no more points left. i'll have to buy them. i'll for my next question.
Kalios
Use @keywords
Partha
Use @keywords
Partha
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Neat, been a while since I saw that one. Ah, the joys of list processing.
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
SUPER HEMANTH - If I could increase the font size I would do it to the biggest.
thanks
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.
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.
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.
ASKER
ok i get it...
a := @Replace(A2;fieldwhereisto redduplica tesfromyou rcode;"");
@If(fieldwhereistoreddupli catesfromy ourcode = a2; @SetField("a2";a) ;"");
@Command([ViewRefreshField s])
this works fine.... can i do any better.
kalios
a := @Replace(A2;fieldwhereisto
@If(fieldwhereistoreddupli
@Command([ViewRefreshField
this works fine.... can i do any better.
kalios
You are good with the code
@If(a2 *= a1;@Failure("cannot enter duplicates");@Success)...
~Hemanth