Fixed – We can’t find the form page you’re trying to load – Dynamics 365 Marketing


Recently we saw the below error in one of our marketing forms hosted on the website –

We can’t find the form page you’re trying to load: <div data-editorblocktype=”FormBlock” data-form-block-id=”64d87bc7-279d-ed11-aad1-00224814fd52″></div>. Please check your page setup.


This occurs if the form is not Live.


Making the form “Go live” will fix the issue.


Hope it helps..

Advertisements

Fixed – The domain where this form is embedded might not be enlisted as a domain record for externally hosted forms in Dynamics 365 Marketing


Recently we were getting the below issue for our Marketing Forms hosted on an external website on a particular authenticated domain. The pages were working fine in other authenticated domains.

The domain where this form is embedded might not be enlisted as a domain record for externally hosted forms. Otherwise, a browser extension or plugin may be blocking this form from loading. Review and reload form to continue.”

This particular domain was also shown as authenticated in our Dynamics 365 marketing.

Our website was e.g. https://www.domain.kiwi/ so we had domain.kiwi authenticated in Dynamics 365 Marketing.

Eventually, we had to raise a Microsoft Support Ticket and were instructed to add/ authenticate www.domain.kiwi   (with www.) also, doing so resolved the issue for us.

Also, there seemed like a UI bug in the Marketing which will cut out “www.” automatically when trying to authenticate the domains.

Hope it helps..

Advertisements

Interesting articles on Plugin behavior – Dynamics 365 / Dataverse


Found below interesting articles, do check out- 

Can we create child records in Pre-Operation Plugin?https://community.dynamics.com/forums/thread/details/?threadid=1e757e7a-60b2-4fc6-9a94-acea44b18f8c

What happens when we use ExecuteMultiple within Plugin?https://www.inogic.com/blog/2015/11/executemultiple-workflow-or-plugin-assemblies/

Advertisements

ParentContext property of IPluginExecutionContext – Dynamics 365 / Dataverse


Recently we had to write a plugin that should trigger only when a user has manually associated the record from the form (N-N relationship). This was because we were also doing the same association through another plugin, in which case we didn’t want this new plugin to trigger.

Here we can make use of ParentContext property to identify if the plugin is getting triggered because of another plugin.

Below we can see ParentContext property getting populated and also in the InitiatingUserId property we get the id of the user who triggered the plugin.

And if the user has manually performed the association from the form, we can see ParentContext being null.

Hope it helps..

Advertisements

Associate/Disassociate plugin messages in CRM


Sample Code –

 public class MyPlugin: IPlugin
    {
        public void Execute(IServiceProvider serviceProvider)
        {
            ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
            IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
            IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
            IOrganizationService orgService = factory.CreateOrganizationService(context.UserId);

            try
            {
                tracingService.Trace("start plugin execution: {0}", this.GetType().FullName);
                if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is EntityReference && context.ParentContext == null)
                {
                    tracingService.Trace("Parent Context is null");
                    if (context.MessageName == "Associate")
                    {
                        if(context.InputParameters.Contains("Relationship") &&
                            ((Relationship)context.InputParameters["Relationship"]).SchemaName.Equals("schemaname"))
                        {
                            tracingService.Trace("Relationship Found");
                            if (context.InputParameters.Contains("RelatedEntities") && context.InputParameters["RelatedEntities"] is EntityReferenceCollection)
                            {                                
                                var primaryEntity= (EntityReference)context.InputParameters["Target"];
                                var  relatedEntities= context.InputParameters["RelatedEntities"] as EntityReferenceCollection;
                                                           
                            }                           
                        }  
                    }
                }

                tracingService.Trace("end plugin execution: {0}", this.GetType().FullName);
            }
            catch(InvalidPluginExecutionException)
            {
                throw;
            }
            catch (System.ServiceModel.FaultException<OrganizationServiceFault> ex)
            {
                tracingService.Trace(ex.Detail.Message);
                throw;
            }
            catch (Exception ex)
            {
                tracingService.Trace(ex.ToString());
                throw;
            }
        }

      
    }

Rajeev Pentyala's avatarRajeev Pentyala – Technical Blog on Power Platform, Azure and AI

In CRM, the Associate or Disassociate event happens

  • If you have a N:N relationship between two entities and when you try to associate or disassociate records either from Associated view or Sub grid.

Entity Associate View Entity Associate View

In Plugins, the Associate & Disassociate messages behave little different than other messages.

  • When you register a plugin on Associate message, you have to leave “Primary and Secondary” entities as ‘none’.

Associate Plugin Step Associate Plugin Step

  • Since we don’t provide entity names, the registered Plug-in step triggers on all “Associate” operations, so we have to check few conditions to let the “Association” trigger happen only between intended entities.

You can use the below code template for Associate or Disassociate plugins

            EntityReference targetEntity = null;

            string relationshipName = string.Empty;

            EntityReferenceCollection relatedEntities = null;

            EntityReference relatedEntity = null;

            if (context.MessageName == “Associate”) {

                // Get the “Relationship” Key from context

                if…

View original post 93 more words

Missing dependencies – You’ll need to import the following items to this environment error while importing the solution – Dynamics 365 / Dataverse


Recently while trying to import one of the solutions we got the below error

Missing dependencies. You’ll need to import the following items to this environment.

It was referring to one of the Managed Solutions – DynamicsMKT_PushNotification, managed by Microsoft, for Microsoft Dynamics 365 Marketing.

We realized that the source environment had a higher version installed than the destination environment.

Source – 1.1.25335.61 and destination environment – 1.1.22667.44

Initially, we thought the error is because the Dev had full marketing app configured i.e. both Solution and Services app configured and the destination had only Dynamics 365 Marketing Solution Only app.

The marketing apps –

After raising the Microsoft Support, we got guidance/advice from the Microsoft Support / Product team that the Dynamics 365 Marketing Solution Only app was not installed in the destination environment and it was a copy of some other environment that had marketing installed. They suggested installing the Dynamics 365 Marketing Solution Only app in the destination environment. After installing the app, we could see the version of the DynamicsMKT_PushNotification solution increased and were able to install our custom solution successfully.

Hope it helps..

 

Advertisements

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓