list of unique values in a BOs attributes?

Contains tips for configurators working with Aware IM
Post Reply
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

list of unique values in a BOs attributes?

Post by tford »

Is there a way to create a list of the unique values of a given BOs attributes? For example, if various instances of Customer.ContactLastName include:

Moses
Brown
White
Coe
Brown
Moses

I would like to see a list that includes only (now alpha sorted):
Brown
Coe
Moses
White


Thanks!
Tom
Hubertus
Posts: 153
Joined: Sat Feb 11, 2006 2:11 pm
Location: Austria
Contact:

Post by Hubertus »

Hi Tom,

The following rule does the job:

Code: Select all

IF NOT(EXISTS LastNames WHERE (LastNames.LastName=Customer.LastName)) THEN CREATE LastNames WITH LastNames.LastName=Customer.LastName
http://www.hiden.org/files/u1/Uniqueness.bsv

Hope it helps,
Hubertus
Hubertus
Posts: 153
Joined: Sat Feb 11, 2006 2:11 pm
Location: Austria
Contact:

Post by Hubertus »

In case you want to use the above on existing data then you need to run the following process once.

Code: Select all

FIND ALL CUSTOMER
UPDATE Customer
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Super -- I'll give it a shot. You have an amazing understanding of AwareIM functions. :D I'm glad you are active in the forum

Tom
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Thanks Hubertus. Pete's demo in his May 14 post at http://www.awareim.com/forum/viewtopic.php?t=1548 now has a link to a demo + bsv that shows this functionality.

It also shows how to achieve dropdowns of existing database values in a search form.

Tom
Post Reply