web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Trigger a plugin on page reload in crm dynamics 365

(0) ShareShare
ReportReport
Posted on by

I have an implemented plugin developed in visual studio (we are not using plugin registration tool crm 2016). I want to trigger this plugin on page reload. To explain this plugin is fully developped, it loads the contact information to a form onload event. The idea is that if the user modifies the contact inforation in the form contact, he should be able to reload the form which will execute the plugin.

How can i do this ?

Thank you!

This is the actual plugin which is executed on creation:

AddStep(Stages.PreOperation, Messages.Update, Modes.Synchronous, DlcocontractorDefinition.EntityName, nameof(CompleteCoContractorInformation));
        AddStep(Stages.PostOperation, Messages.Update, Modes.Synchronous, DlcocontractorDefinition.EntityName, nameof(AssociateCoContractorAddresses));
        AddStep(Stages.PostOperation, Messages.Update, Modes.Synchronous, DlcocontractorDefinition.EntityName, nameof(AssociateCoContractorNationalities));

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     the only way you can trigger a plugin is by sending some data to the server, so you will need to save that record, so do just that.. save it.. You might use javascript for that (see "save" at the link below):

    msdn.microsoft.com/.../dn481607.aspx

     Or, if that's not what you want, then you probably need to convert that plugin to a custom action and call it from javascript:

    community.dynamics.com/.../web-api-executing-custom-action-via-javascript

  • Community Member Profile Picture
    on at

    Hello, I modified the question may you please give me an update on it

  • ashlega Profile Picture
    34,477 on at

    Hi,

     the problem is that the line below does not make sense for the plugins:

    "it loads the contact information to a form onload event."

     And, subsequently, this does not make sense either:

    "he should be able to reload the form which will execute the plugin."

     Plugins don't run in form onload - that's only applicable to javascripts. They run "on update"/"on create"/"on delete"/"on retrieve".. and there are other messages.. but all are server-side (have nothing to do with the forms)

     If you want the plugin to run on the update of the record, you just need to register it on the update message.

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    What exactly is your plugins support to do?

    You might be able to use a Retrieve Plugin to get the results that you are looking for?

  • Community Member Profile Picture
    on at

    The plugin loads the conatact information when the page is loaded (when creating new record), I am thinking about adding a button which saves the form and execute the plugiin on update. How I can do this ?

  • Community Member Profile Picture
    on at

    The plugin loads contact information like name, full name ...

    I should trigger the plugin to reload the information to the form if the user updates the contact information in the form contact, like changing user name ..

    I am thinking about adding a button which saves the form and execute the plugiin on update. How I can do this ?

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    As Alex mentioned above, there are the following options.

    If you want to use the Save button functionality to call the plugin, you can use it on the Create or Update messages.

    If you only need this for new records, then all you need is the create message.

    You can add your own validation if needed before saving to make sure that the user entered all the information.

    If you need to call a Plugin On Demand, without performing any particular Save action, you must do this by creating Actions.

    Hope this helps.

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    This is for an entity, that has some sort of connection to the Contact entity, so you want the Contact information to reload in case that information was updated in the Contact entity?

    Is that the case?

  • Community Member Profile Picture
    on at

    Yes, exactly this is the case

  • Surender Vishwanatham Profile Picture
    255 on at

    Assume you have Contact and Case entity. And you have relationship between contact and case entity.

    If user update contact information on one of contact record then all the related case's should be update with latest contact information? Is this your requirement?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans