Bug Report B96968
Visible to All Users

Deleting from the DetailView raises an exception

created 17 years ago

Deleting multiple detailview items still results in the exception "Requested objects cannot be loaded, because they are absent in the data store. These objects can be already deleted/purged…".
I've been able to figure out the circumstances under which still still happens. I have created a sample application which you can use to replicate the error. You'll only have to update the connectionstring, there is no data(file) supplied.
Steps to Reproduce:
Preparations:
- Run the application. Add 1 "Master Record" object using the "New" button in the mainform.
- Fill out a code and description (not mandatory)
- Save the Master Record and exit.
- Exit the application.
Now the database contains at least 1 Master Record object. Now the error can be reproduced:
- Run the application. Doubleclick the previously made Master Record. The detailview will open.
- Click the "New" button for the Details like 4 times to have 4 Detail Record objects appear.
- Exit the grid editor by clicking in the grid's white space.
- Click the Save button for the Master Record's detailview.
- Click the grid to focus it and hit CTRL-A to select the 4 Detail Record objects.
- Click the Delete button for the Detail Record listview.
- Click the Save button for the Master Record's detailview.
Now the exception definiately should appear. If not, please let me know.

Show previous comments (2)

    Alright Mike,
    I've been able to acquire te 8.2.3 versions for both the DXperience and XAF files by replacing the last version digit in the download URL.
    I have tested with the same sample application, and unfortunately yes, the problem still persists. I have to apologize though, the steps to reproduce I provided you with weren't entirely accurate. I did them myself, and following them exactly as I wrote them the exception does not occur indeed.
    It seems that the add-save-multiselect-delete-save procedure for the details works fine for masters which have been added during the current application session. It fails when you start a new application session, opening a master that does not have any details yet. Please note that I have updated the steps to reproduce.
    Now things should be going wrong on your end as well ;)
    Sincerely,
    Leonard.

    DevExpress Support Team 17 years ago

      Hi
      Thank you for your new steps to reproduce. Now we've reproduced the problem and found a workaround to solve it.
      Please add the following code into the Entity class:

      C#
      protected override void OnLoaded() { foreach(XPMemberInfo memberInfo in ClassInfo.AssociationListProperties) { XPBaseCollection collection = memberInfo.GetValue(this) as XPBaseCollection; if(collection != null && collection.IsLoaded) { collection.Reload(); } } base.OnLoaded(); }

      Of course, this problem is fixed in the next release 8.2.4.
      Thanks
      Mike V.

        Thank you Mike,
        The offered workaround works properly for me. I flagged it as "to-be-removed" for the next version update.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.