Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
A few days ago I wrote a blog post about word/excel templates:
And got a few interesting responses – it’s great to have readers who can point out something you don’t know.
One of the comments was that we can’t, really, control how related entities in Word Templates are retrieved. Come to think of it, that’s a really important drawback. For example, if I wanted to have a word template for the account entity just so I could see some information on the account itself, and, also, on the open opportunities associated with the account, I would not be able to control which opportunities would show up.
Have a look at the screenshots below. There is an account with 3 open opportunities:
There are, actually, 4 opportunities linked to the account. But one of them is a closed opportunity:
So, I created a very simple Word Template, and here is what I see there:
All 4 opportunities are displayed in the generated document.
Unfortunately, there is no way to define conditions and/or other query parameters (sorting, for example) for the related records when creating a Word Template.
But wait, what if I created a Retrieve Multiple plugin – would I be able to update those queries at “run time”?
As it turned out, Word Templates just ignore RetrieveMultiple plugins all together. Which actually means there are some other interesting implications:
It’s easy to test – you might create a plugin using the code below:
public void Execute(IServiceProvider serviceProvider)
ITracingService tracingService =
IPluginExecutionContext context = (IPluginExecutionContext)
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
throw new InvalidPluginExecutionException(“Test”);
All this plugin will do – it will throw an error. So, for example, with this plugin registered in the pre-operation for “RetrieveMultiple” on the Opportunity entity, I can’t load any opportunities view:
Which means I should not be able to create a document using my Word Template above.. And, yet, I can still create that document:
Interesting, isn’t it? Well, all we can do is keep this in mind for now – hopefully, there will be some workaround in the future versions.
Business Applications communities