locked
how to get parent case values via xrm? RRS feed

  • Question

  • Hello - I have a requirement where I need to give users the ability to create child cases. There are about 10 case form field values that the users want copied from the parent case to the child case by default. It seems like I need to do this through Xrm via the onload function in the case js, so the form is pre-populated with the expected values, which the user can then modify.

    However, I'm not sure about the best way to go about doing this. It looks like, when I select Case > Children from the left nav bar, and then click the "Add New Case" button, CRM opens a new Case form with a _CreateFromId parameter in the query string.

    I could probably make an oData call from the js to retrieve the parent entity by this ID but I wasn't sure if there was a quicker, more appropriate Xrm function build into the framework that would be more appropriate to use for this?

    Tuesday, August 27, 2013 11:26 PM

All replies

  • It sounds like you have a custom relationship set up. If so, and depending on the type of relationship, you can edit the mappings which will cause the fields you specify to prepopulate based on values in the parent.

    To do this, view a list of cases, then click 'Customize' > 'Customize Entity'. Then click '1:N Relationships' and find child case in the list of relationships. Double click the relationship to open it up and edit mappings.

    Wednesday, August 28, 2013 5:30 AM
  • thanks kreed! That handled most of the child case mapping that I needed to do.

    I have 1 remaining piece to implement.  I have a many-many list section on the case form, that needs to be populated with the same info as the parent.

    The many-many list section is implemented as a custom relationship. What's the proper way to put this same info into the same list section on the child form?

    Mapping is not available for this. My first impression is that this will need to be populated through xrm, but I'm not sure how this would be done?  Or is there a more appropriate way to do this?

    Wednesday, August 28, 2013 7:15 PM