locked
Assign RRS feed

  • Question

  • Hi all,

    Is it possible to fire any java script event when a record is assigned?
    Saturday, July 11, 2009 5:59 AM

Answers

  • Hi,

    AFAIK, it's not possible. When a record is assigned to somebody else, you can hook on the message using the Plugin or Workflow, but not javascript event.

    If you provide a client side event on the implementation of javascript button, that client side event will be triggered BEFORE firing your SDK codes.

    Regards,

    hadi teo
    Saturday, July 11, 2009 6:07 AM

All replies

  • Hi,

    AFAIK, it's not possible. When a record is assigned to somebody else, you can hook on the message using the Plugin or Workflow, but not javascript event.

    If you provide a client side event on the implementation of javascript button, that client side event will be triggered BEFORE firing your SDK codes.

    Regards,

    hadi teo
    Saturday, July 11, 2009 6:07 AM
  • Hi,

    The answer is yes and no, actually. It is possible to fire the OnChange event and your JScript code when a record is assigned in one situation only - if you assign the record by changing the value of the owner field on the form by using Auto Resolve feature. So, if you enter the name of the new owner and let the lookup field resolve the name, then the code on the OnChange event will fire.
    However, if you open the lookup window to assign the new owner or you simply choose "Assign..." from the menu, the JScript will not execute.

    I would suggest using wokflow to accomplish your task.

    Best regards,
    Kuba
    -- Kuba Skałbania, Netwise
    Saturday, July 11, 2009 2:55 PM
  • Hi Golden Fish,

    You can actually fire Javascript on OnSave 'cause whenever the owner changes using CRM Form, the OnSave fires in any case.[Auto Resolve or Assign from Menu or by launching the dialogue box].

    So what I generally do is, OnLoad I store the current owner, say

    OnLoad
    document.prevOwner = crmForm.all.ownerid.DataValue;

    and then

    OnSave
    if(document.prevOwner != crmForm.all.ownerid.DataValue)
    {
     // Take necessary actions in case of Owner has changed
    }

    If needed, you can cancel the OnSave event and provide an alert message to the end user.


    Regards,
    Chinmay
    http://metrix.blogspot.com
    • Proposed as answer by Chinmay Patel Tuesday, July 14, 2009 8:01 AM
    Saturday, July 11, 2009 10:31 PM