locked
Calling a JScript method from a plugin RRS feed

  • Question

  • Hello friends,

     

    I have a doubt if a JScript method/function, which is there in a web resource,  to be called from a plugin.

     

    The purpose of this is when a record is assigned to someone, i need to trigger a plugin, which in turn should alert them with a jscript alert or something similar that the record is assigned to them and also send them a mail.  From then on, every 30 minutes the record is with them, an alert should be made to them.

     

    Please help me out on this and thanks in advance for your replies.

    Tuesday, November 29, 2011 4:50 PM

Answers

  • hi palani ,

     if you want to notify the second user if the Record is assigned

     why dont you send email from the Plugin itsself , trap the Ressign message of the Entity and Send a message.

    Else if you want to show a notify alert message when the record is open ,

     you can set a Notify Flag in the Plugin which would then script in the open Event of the form to check if the flag was set

    and display appropriate message .

     

    hope this helps

    let us know if you have further query

     if the response answered your question, please take a minute and mark the response as an answer.

    dkay

    • Marked as answer by CRM_Intuition Friday, January 20, 2012 2:15 AM
    Wednesday, November 30, 2011 5:21 AM

All replies

  • Hello,

    Unfortunately you would not be able to call JS function from your plugin.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter
    Wednesday, November 30, 2011 1:43 AM
    Moderator
  • Andriy is right, you can call a jscript from a plugin. But you can call a workflow from a plugin. You can create an on demand workflow that would send an email as an alert. You can then also configure the workflow to wait for 30 minutes and resend the alert mail.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Wednesday, November 30, 2011 3:17 AM
  • Plugins runs on Server and they do not have any access to CRM pages. In your design on showing alerts, where exactly (which page of CRM App?) you want to show JavaScript alerts?

     


    MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Control (Beta)
    Wednesday, November 30, 2011 3:18 AM
  • Thanks all for your replies.

    @Makarand:  Actually, here one user asigns a custom entity record to another user.  The second user (to whom the record was assigned to) should get this alert when he is working on this record.

     

    What my idea was to call a plugin when the record was assigned, which in turn would call a javascript function which is published in the Onload event of the entity form.  In the javascript function, I implement the timer and trigger the workflow and all.  But now, since javascript could not be called from plugin, I have to try to call the workflow from plugin as suggested by  Sam-Inogic. 

    Please let me know if you have any other suggestion.

    If any of you have some sample to call a workflow from a plugin, please post it here.

    Thanks again


    Palani K.B.
    Wednesday, November 30, 2011 4:41 AM
  • hi palani ,

     if you want to notify the second user if the Record is assigned

     why dont you send email from the Plugin itsself , trap the Ressign message of the Entity and Send a message.

    Else if you want to show a notify alert message when the record is open ,

     you can set a Notify Flag in the Plugin which would then script in the open Event of the form to check if the flag was set

    and display appropriate message .

     

    hope this helps

    let us know if you have further query

     if the response answered your question, please take a minute and mark the response as an answer.

    dkay

    • Marked as answer by CRM_Intuition Friday, January 20, 2012 2:15 AM
    Wednesday, November 30, 2011 5:21 AM
  • You need not have to have plug-in to call workflow. Workflow has its own triggering point which you can use.

    As shown below you can use "Record is assigned" event. Workflow will be fired every time Ownership of the user changes, so you can  call "Send Email" activity to send email to new owner of the record. 


    MaKeer | myencounterwithcrm.wordpress.com | CRM2011 User Settings Utility | CRM2011 Lookup Preview | CRM2011 Lookup Attribute Mapping | CRM2011 TreeView Control (Beta)
    Wednesday, November 30, 2011 5:32 AM
  •  
    Hi

    Did this help?

    Please make sure to mark as answer to the response that helped you get through. This will help others with similar problem identify the answer and also close this thread as resolved.

    Thanks

    Dkay

    Wednesday, November 30, 2011 2:39 PM
  • I first would like to thank everyone for their replies.

     

    @Crm_Developer:  I will try all these suggestions and if my requirement is achieved, then I will post the steps and mark the answer which helped me also. 

    I know Emailing is quite easy with workflows, but also, every thirty minutes the record is with the second user, a JScript alert to the second user and a mail to the first user is needed , that is the main reason I was looking for some plugin and other things.  I thought may be using JScript and some timer function, I can alert the second user as long as the record is with him.

    Anyhows, I will try and let you all know.


    Palani K.B.
    Wednesday, November 30, 2011 5:25 PM