1

I have an entity named Events (parent entity) which contains the following attributes

  1. EventID
  2. EventStartDate
  3. EventEndDate

which has 1-N relationship with another entity named ChildEvents which contains the following attributes

  1. ChildEventID
  2. EventID(lookup)
  3. EventStartDate(read-only)
  4. EventEndDate(read-only)

I have written a JavaScript code that auto-populates the EventStartDate and EventEndDate when the EventID is updated.

My question is this:

I have an EventID = "A" with EventStartDate = "today" and EventEndDate = "tomo" and this is added to a ChildEventID = "C_A" and saved.

I go back to my Events entity and change the start date and end date on EventID = "A" to something else and save the same.

Now when I open the child event record "C_A" I do not see the NewEventStartDate and NewEventEndDate being updated automatically.

Am I missing something? Do I have to write a code for it? Because I thought it would get updated automatically.

Note: Both entities are customized entities.

4

3 に答える 3

2

You want to make the parent update its children when the dates in the parent is changed? Then you should write a plugin (on the parent entity).

于 2013-01-18T23:09:58.687 に答える
2

I understand this: You want to update the child records of an entity based on the changes made in parent entity. If we assume this, you should use distributed workflow. This link helps you. This is a straight forward solution which you could import and use easily.

于 2013-01-19T13:30:42.970 に答える
1

Very good question! What you need to remember is that JavaScript only managed the client-side of the process. It means, a little bit incorrectly but easy to understand, that whatever you do using JS simulates what the user can cause by navigating in the GUI themselves.

If I got your question correctly, you want the data in an entity (read-only fields on the child entity) to get an update when an other entity (the start date on the parent entity) is updated.

The most robust and reliable way to do that is to add a plugin that reacts to the message update (and, of course, also to the message create) and do the magical update from there.

The downside of that approach is that the threshold for a beginner might be very, very steep. Especially if you lack experience from C#, registering steps/images, konfiguring and uploading assemblies etc. (First time I made a plugin, I managed to FUBAR our CRM server and it took an MVP two days to get it up and running again. And I've been coding C# since over a decade, haha.)

The upside is that once you've got it working, you can do pretty much anything with CRM. The limits are gone. If you intend on working with CRM, that's the way to go. It's a hard way but it's also the only, serious way, IMHO.

And if you need pointers on the plugin - check out the blogs. (Mine is the best, of course, hehe.) And keep on asking!

于 2013-01-21T22:02:04.297 に答える