Relate custom entity to Invoice Product RRS feed

  • Question

  • We've created a new entity called Tax Detail Lines that we want to relate to the Invoice Product Entity.  For every Invoice Product line there can be one or more Tax Detail Lines.  Unfortunately, there doesn't seem to be a way to create this type of relationship in CRM 2015.

    When we try to create a N:1 relationship from the Tax Detail Lines entity, the Invoice Product entity is not available from the list of Primary Entities.  Trying to create a 1:N relationship from the Invoice Product entity doesn't work as there is no button to create this type of Relationship. 

    Any idea what we can do here?

    Friday, April 3, 2015 7:51 PM

All replies

  • Hello Cipher,

    The relationships between Invoice Product are not visible in the customization menus OOB. You can check this for more details


    Regards, Abhishek Bakshi If you find this post helpful then please Vote as Helpful and Mark As Answer. Check my blog on https://mydynamicscrmblog.wordpress.com/

    • Edited by Abhishek73 Saturday, April 4, 2015 3:10 AM
    Saturday, April 4, 2015 3:10 AM
  • Hi Abhishek,

    I believe that technique is for existing relationships defined in CRM, but that are hidden from the UI (for example, Quote Product to Order Product).  By adding mappings, it looks like it will allow custom fields to flow from along the predefined relationships.  That is cool, but I don't believe it helps my requirement.

    I want a new relationship defined between the Invoice Product entity and my custom entity Tax Detail Lines. This relationship would mean that for each Invoice Product there could be 1:N Tax Detail Lines.  As well, by adding a Sub-grid to the Invoice Product form, I could then see all the related Tax Detail Lines.

    Saturday, April 4, 2015 3:33 AM
  • Hello Cipher,

    Unfortunately, opportunityproduct entity is one of those entities that which has a few restrictions on it's customisation, not sure why. I dont think you will be able to achieve this using a OOB solution however if you write a plugin that can be acheieved.

    Coming to your scenario, can you not handle this Tax Line details at Invoice Level rather at Invoice Product level, considering that every invoice will have one tax detail?

    Regards, Abhishek Bakshi If you find this post helpful then please Vote as Helpful and Mark As Answer. Check my blog on https://mydynamicscrmblog.wordpress.com/

    Saturday, April 4, 2015 5:31 AM
  • Thanks, Abhishek.  It looks like a plugin to handle the logic is needed.  I'll have to add a string to store the Invoice Product GUID and then handle all events to Create, Update, Delete the custom lines.

    I'm not sure what you mean by handling it at the Invoice Level as I need multiple lines per Invoice Product.  These line taxes then will get rolled up to the Invoice Line and all Lines rolled up to the Invoice.

    I found the following text from Microsoft here - https://technet.microsoft.com/en-us/library/dn531171.aspx

    Custom 1:N relationships can’t be created for all entities. When this is true there will simply be no option to create a new custom entity relationship using the solution explorer.If New 1-to-Many Relationship does not appear on the Actions toolbar, you cannot create a 1:N relationship for that entity.

    It is strange that creating a 1:N relationship against the Invoice Product entity isn't supported.

    • Edited by Cipher Saturday, April 4, 2015 2:36 PM
    Saturday, April 4, 2015 2:36 PM