Check record uniqueness (multi record uodate)


Author
Message
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I allow user to add more than one record (let say order lineitems), then only press save button to in one batch.

I need to check for record uniqueness after new record added.

1. How to check uniquness before actually save to db?

2. If I loop thru the records to check for uniqueness, any impact if my "record pointer" moved?

Thank you

Replies
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Thank you for reply.

Your sample code is to check if any duplicate record already stored in DB.

How about still in memory? My form allow user to add multiple records then only save.

BTW, anything need to set for multi records update? I remember that is a property to set for multiple record update but I cant recall where exactly. I failed to get it back from doc.

Thank you

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
You can modify the source code to look through the BO as well.  You can do this a lot of different ways.  Save off the record pointer and scan through the BO.  Or reference the CurrentDataTable and do a select.

MyBO.CurrentDataTable.Select("MyTestField='TestVa'ue'").Length > 0

Combine the local and the server values to get your final result.  Be sure to always exclude the current record otherwise this will return an incorrect value.

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