Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • K.Garrein 164 posts 629 karma points
    May 13, 2014 @ 09:02
    K.Garrein
    0

    Delete address using code

    Hey.

    My clients webshop allows saving of multiple shipping addresses per customer.

    Now they want a customer account page listing the customer addresses with edit and delete buttons for every address.

    The edit works fine, but when I try to delete an address I get following error.
    I think I'm not deleting it the correct way? Or is deleting an existing address not allowed for some reason?

    deleted object would be re-saved by cascade (remove deleted object from associations)[UCommerce.EntitiesV2.Address#1149]

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: NHibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)[UCommerce.EntitiesV2.Address#1149]


    Thank you.
    Kris.

  • K.Garrein 164 posts 629 karma points
    May 13, 2014 @ 09:06
    K.Garrein
    100

    Removing the address from the Customer first solved the problem :-)

    CustomerService.Current().Addresses.Remove( uAddress );
    uAddress.Delete();

     

    Regards.
    K. 

Please Sign in or register to post replies

Write your reply to:

Draft