Forums

Forums / Bugs & Issues / "Delete" not working correctly with N:N Sub-Grid View

"Delete" not working correctly with N:N Sub-Grid View

Thread is closed for posting
5 posts, 1 answered
  1. phongchoi
    phongchoi avatar
    3 posts
    Registered:
    05 Jul 2016
    05 Jul 2016
    Link to this post
    Hello,

    I have on contact form a Sub-Grid View with N:N relationship between Contact and Class (new_class) which is called "new_contact_new_class"
    When "Allow Deleting Records" is enabled, I can delete record but the deleted record is not the relationship between Contact and Class, but the Class is deleted.
    This should not be the case. This should delete the "new_contact_new_class" record instead.

    How can we achieve this?

    Thanks,
    phongchoi
  2. Clinton Bale
    Clinton Bale avatar
    126 posts
    Registered:
    21 Feb 2014
    Answered
    07 Jul 2016 in reply to phongchoi
    Link to this post
    Hello Phong,

    When deleting through a sub-grid configured to use N:N relationships, the delete command will always delete the primary entity of the fetch XML.

    To delete any other entity, try inverting the Fetch XML so the one you wish to delete is the primary entity of the fetch. This would also involve switching the relationships around to make it work when inverted.

    Let me know if you have any other additional questions.

    Regards,
    Clinton     
  3. Clinton Bale
    Clinton Bale avatar
    126 posts
    Registered:
    21 Feb 2014
    07 Jul 2016 in reply to phongchoi
    Link to this post
    Take a look at the following thread, a similar question has been resolved:

    https://www.crmportalconnector.com/developer-network/forums/developing-portals/add-remove-n-n-relationship
  4. phongchoi
    phongchoi avatar
    3 posts
    Registered:
    05 Jul 2016
    11 Jul 2016
    Link to this post
    Hello Clinton,

    How to call the CRM Web API from Portal Connector to disassociate records of N:N relationship?

    Many thanks,
    phongchoi
  5. Clinton Bale
    Clinton Bale avatar
    126 posts
    Registered:
    21 Feb 2014
    13 Jul 2016 in reply to phongchoi
    Link to this post
    Phong,

    In the response to Juliens post I was referring to rolling your own WebService that handles disassociation of N:N utilising the TPC API. There is no specific web-service that will accomplish this out of the box.

    Regards,
    Clinton
5 posts, 1 answered