Whats the easiest way to delete all records in a business object and update the server


Whats the easiest way to delete all records in a business object and...
Author
Message
Mike Thomas
Mike Thomas
StrataFrame Beginner (36 reputation)StrataFrame Beginner (36 reputation)StrataFrame Beginner (36 reputation)StrataFrame Beginner (36 reputation)StrataFrame Beginner (36 reputation)StrataFrame Beginner (36 reputation)StrataFrame Beginner (36 reputation)StrataFrame Beginner (36 reputation)StrataFrame Beginner (36 reputation)
Group: Forum Members
Posts: 26, Visits: 82
Whats the easiest way to delete all records in a business object and update the server? Also, how do you supress the "Are you sure message?"?.  the following does not seem to be working....

Me.CasedetailBO.Clear()

Me.CasedetailBO.FillByCaseNum(lcSRNum)

Me.CasedetailBO.MoveFirst()

Do

Me.CasedetailBO.DeleteCurrentRow()

Loop While CasedetailBO.MoveNext

Me.CasedetailBO.Save()


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
Whats the easiest way to delete all records in a business object and update the server?

Just enumerate the BO and call the DeleteCurrentRow method on the BO.  You can also create an array of the PKs if you have the need and then delete each of the records individually by enumerating the array of the PKs that need to be deleted.  Just FYI, Clear() does not delete the BO.  It resets the BO without a fill and you will lose any changes that needed to be committed.

Also, how do you supress the "Are you sure message?"?.

Just set the AutoShowDeleteConfirmation property on the form to False.

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