How to check for duplicates on current business object


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I am using a BO with multiple rows taken from the Database Table and want to ensure that I do not have any duplicates (On the BO) before I save.

If I was doing this against the database Table, I would issue someting like:

Select Country , Count(Country) as MyCount from MyTable Group by Country                 and then Test that myCount was not greater than 1

Is there any similar construct I can use for Business Object   i.e. be able to search through the BO and let it throw up any duplicates.
Replies
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Did you read Paul's post? Or maybe I am misunderstanding what you are looking for.

MyBO.CopyDataFrom(MyOtherBO.CurrentDataTable.DefaultView.ToTable(True, New String() {"DistictColumn-ColumnName"}), MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromCompleteTable)


This should copy only "distinct" rows from MyOtherBO to MyBO, based on the "DistinctColumn-ColumnName".
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Ivan. I am not seeing this. Maybe an example might clarify.

Say in the BO . I have following:

IRELAND
UK
USA
JAPAN
CHINA
IRELAND
FRANCE
BELGIUM
CHINA


I want the duplicates in this (So that I can display an error message , as there should not be any duplicates) . So I want returned:-

IRELAND
CHINA    


(If I was doing this in Sql, I would use a Select Country ,Count(Country) as MyCount from Mytable Group by Country   (And anywhere MyCount > 1 are the duplicates)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search