locked
Refrence parent entity RRS feed

  • Question

  • HI,

    I have a 1:N relationship between Customer and Order entities. I'm trying to create a method in C# that creates an Order record and relates it to its parent entity Customer. The input value is CustomerName. The steps are as follows:

    1. Obtain CustomerId from CustomerName

    2. Create the Order record

    3. Reference the new Order record to the CustomerId

    How could I accomplish this task in CRM 2013?

    Thanks,

    Leszek


    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Monday, September 8, 2014 2:10 PM

All replies

  • The example code in the CRM SDK should be sufficient for you to do this. You are more likely to get assistance here if you provide the code you have, and the specific areas you have trouble with. It would also be helpful to know where your code is intended to run - e.g. within a plugin, or in an external application

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Monday, September 8, 2014 9:26 PM
    Moderator
  • Hi,

    You can simply create a new order entity record via plugin.

    register that plugin step to your desired message and entity.

    and you need to just set the entity reference look up in order for the entity you want to relate order.

    Regards


    Deepak Jangra

    Wednesday, September 10, 2014 11:42 AM