Question Status

Verified
Jyoti Raju asked a question on 22 Aug 2014 10:30 AM

Hi,

Hope someone can help.

I have created a customized entity called Client Agreements and a related entity called Master Service Agreement (MSA). The MSA consists of multiple Client Agreements.

In both forms I have created a Notes box. I want to be able to sync the two fields, for example if a uses enters information in the client agreement Notes field it should bring them notes to the MSA notes field.

Which is the easiest way?

Many Thanks 

Reply
Verified Answer
Scott Durow responded on 27 Aug 2014 3:30 PM

Hi,

You can select 'Append With' when you are updating the note value so that it will always add on to the note field:

Hope this helps,

Scott

Scott Durow

Read my Blog   |  Follow Me on Twitter  |  Rockstar365

Reply
Suggested Answer
Ben Hosking responded on 22 Aug 2014 11:10 AM

it's tricky updating records when you have a 1 to many relationship because there isn't a way to do this using a workflow (because there is no concept of looping)

I would usually write a plugin to update the many.

The other way round you can use a plugin because there is only record to update and you can select this in a workflow

Ben  Hosking

If the my post helped you please mark my post as the suggested answer

Hosk's Dynamic CRM Blog   |  @BenHosk |  Rockstar365

Hosks CRM Dev YouTube Channel

Reply
Suggested Answer
Scott Durow responded on 23 Aug 2014 12:39 PM

Hi Jyoti,

So if the relationship between MSA and Client Agreements is 1:N (as you say the MSA has multiple client Agreements), you can create a Realtime workflow that runs when the client agreement notes field is updated and append the notes to the MSA notes field. See the following for a description of this technique - www.magenium.com/.../Aggregates.aspx

www.powerobjects.com/.../retrieving-data-from-a-related-entity-crm-2013

This does have the disadvantage that everytime the notes field is updated, you'll get a copy on the parent MSA record. Perhaps a better solution would be to show the notes field in the subgrid of Client Agreements on the MSA records.

Hope this helps,

Scott

Scott Durow

Read my Blog   |  Follow Me on Twitter  |  Rockstar365

Reply
Suggested Answer
Ville Andreas Rantala responded on 29 Aug 2014 12:26 PM

Maybe you should try the assignation of fields, i think that's will be the best way for you  to pass the value from A entity to B entity, go to customization, find your A entity and then check out the 1:N and then search for the field assign and creae tehe assignation for the A entity field to the B entity field and always get the complete value in both-

Reply
Suggested Answer
Ben Hosking responded on 22 Aug 2014 11:10 AM

it's tricky updating records when you have a 1 to many relationship because there isn't a way to do this using a workflow (because there is no concept of looping)

I would usually write a plugin to update the many.

The other way round you can use a plugin because there is only record to update and you can select this in a workflow

Ben  Hosking

If the my post helped you please mark my post as the suggested answer

Hosk's Dynamic CRM Blog   |  @BenHosk |  Rockstar365

Hosks CRM Dev YouTube Channel

Reply
Suggested Answer
Scott Durow responded on 23 Aug 2014 12:39 PM

Hi Jyoti,

So if the relationship between MSA and Client Agreements is 1:N (as you say the MSA has multiple client Agreements), you can create a Realtime workflow that runs when the client agreement notes field is updated and append the notes to the MSA notes field. See the following for a description of this technique - www.magenium.com/.../Aggregates.aspx

www.powerobjects.com/.../retrieving-data-from-a-related-entity-crm-2013

This does have the disadvantage that everytime the notes field is updated, you'll get a copy on the parent MSA record. Perhaps a better solution would be to show the notes field in the subgrid of Client Agreements on the MSA records.

Hope this helps,

Scott

Scott Durow

Read my Blog   |  Follow Me on Twitter  |  Rockstar365

Reply
Ville Andreas Rantala responded on 23 Aug 2014 7:03 PM

Hi Jyoti,

In your scenario the best way would be with a WF, when the note change go and update the related record in the same field. But it just would work if you Note Box is a text area Field called Notes or something like that. In other way probably you should try sending activities from your A entity to your B Entity.

Reply
Jyoti Raju responded on 27 Aug 2014 5:00 AM

Thanks for this guys,

I have set up a work flow, but I'm having an issue. If I add a note to one client agreement it updates the Notes field in the MSA however if I add another note in a different client agreement it overwrites the current one.

How can I overcome this challenge?

Many Thanks

Reply
Jyoti Raju responded on 27 Aug 2014 6:35 AM

Thanks for this guys,

I have set up a work flow, but I'm having an issue. If I add a note to one client agreement it updates the Notes field in the MSA however if I add another note in a different client agreement it overwrites the current one.

How can I overcome this challenge?

Many Thanks

Reply
Ville Andreas Rantala responded on 27 Aug 2014 10:39 AM

Set a condittional comparission in the WF, something like this:

IF entity A Client = entity B client then run the rest of the workflow, and when you do the update put the first note value like a dynamic value and next put the note value from the update entity.

Reply
Verified Answer
Scott Durow responded on 27 Aug 2014 3:30 PM

Hi,

You can select 'Append With' when you are updating the note value so that it will always add on to the note field:

Hope this helps,

Scott

Scott Durow

Read my Blog   |  Follow Me on Twitter  |  Rockstar365

Reply
Jyoti Raju responded on 28 Aug 2014 4:36 AM

Hi,

Thanks for that, it was helpful :). However if I update the child record note it still keeps the original note in the MSA Notes field how can I let it update to the new content. Also is there a way to add the note on the next line of the MSA it seems to add the note right next to the previous one.

Thanks

Jyoti

Reply
Suggested Answer
Ville Andreas Rantala responded on 29 Aug 2014 12:26 PM

Maybe you should try the assignation of fields, i think that's will be the best way for you  to pass the value from A entity to B entity, go to customization, find your A entity and then check out the 1:N and then search for the field assign and creae tehe assignation for the A entity field to the B entity field and always get the complete value in both-

Reply
Jyoti Raju responded on 1 Sep 2014 4:47 AM

Hi,

Thanks for that, it was helpful :). However if I update the child record note it still keeps the original note in the MSA Notes field how can I let it update to the new content. Also is there a way to add the note on the next line of the MSA it seems to add the note right next to the previous one.

Thanks

Jyoti

Reply