Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Business Object
Message
From
16/11/2011 07:49:47
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
16/11/2011 07:27:29
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Miscellaneous
Thread ID:
01529025
Message ID:
01529031
Views:
41
Hi Robert,

>Hello. I have a form with 1 primary business object. A user can type in a name and search for that name in the database. Lets say the user performs a search and 2 records are returned. The user then clicks the mmNew button to add a new record to the dataset. I then navigate to the new record and set the LastUpdateDate and LastUpdateUser column(in the click event of the mmNew button). For some reason those 2 fields in the first record of the dataset is being changed too. Even when I comment out the code so that I am not updating those 2 columns they're being changed. If I click the mmCancel button the application throws an error "This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row." The new row does get removed from the grid on the form. I only have this issue when the user performs a search before adding a new record.
>
>I added a clear button that "Gets" an empty dataset. When clicked all records in the grid disapear. I click the mmNew button and it asks me if I want to save changes. There are no changes since the "BO" should be empty.
>
>There's barely any code on this form and no code in the "Rules" of the BO. The only code I have in any of the "mm" buttons is in the mmNew button:
>
> Me.grdEmployees.NavigateData(mmNavigate.Last)
> Me._employee.Entity.LastUpdateDate = Date.Now
> Me._employee.Entity.LastUpdateUser = Environment.UserName
>
>Thanks.

A couple of things. You are navigating the grid to the last record, but are you navigating the data also? Do you have the grid setup as the navigation control? Also, maybe not part of your issue but, do you use the same dataset you searched with to add a new record? I would consider not adding the values to those fields in the click event of the new button. If this is a mmNew default code button, then add your values when you save the record instead. It would be even better to add these values to the business logic as default values for Entity New values, but it you need a strategy for the business layer to have access to the authenticated user from the application level.
Timothy
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform