Adding record to subgrid on select of a look up record in crm 2011 RRS feed

  • Question

  • I have a requirement where i have lookup field in the form. on select of a record in look up i want to add it to a subgrid on the same form on a custom button click.
    Sunday, April 12, 2015 6:29 AM

All replies

  • Hello,

    The lookup and subgrid are 2 relationships I assume (offcourse they are)? Is the subgrid a N:N relation or a 1:N relation? If it is a N:N you should associate the lookup record with your form record (use the XrmServiceToolkit.Soap.Associate() function on Button click). If your subgrid is a 1:N relation, retrieve the lookup record and set the 1:N relationship with your form record (XrmServiceToolkit.Rest.Update() function) . Refresh the grid afterwards?

    I hope this will give you a starting point.

    Kind Regards

    Monday, April 13, 2015 7:45 AM