locked
Firing javascript onchange of owner field in update form RRS feed

  • Question

  • Is there any way so that we can fire javascript on the onChange event of an owner field in the update form of a Microsoft CRM entiy? We have a requirement from the client similar to this. As per the requirement, a javascript should get fired on the onChange event of the owner field in the update form of a CRM entity and it should bypass the confirm assignment dialog box which comes up when a user tries to modify the owner of an entity record. Thanks in advance.

    Friday, March 12, 2010 11:56 AM

Answers

  • Hi

    When a owner button (icon) is clicked assignObject ("1088") is called using onshowdialog.
    i.e. onshowdialog="assignObject ("1088")"

    You can bypass this window by overriding ownerid button onshowdialog property.

    Hence "Confirmation Assignment -- Web Page Dialog" will be bypased and "Look up redords -- Web Page Dialog" will be opended.

    On Load():

    document.getElementById('ownerid').onshowdialog = "newpage.html";


    Regards
    Vinoth


    Friday, March 12, 2010 1:37 PM

All replies

  • You can try ownerid_onchange0() to fire the event but I have a feeling if the field is readonly that the event may not get fired.

    If you do get it to fire then you could place some code in the onchange event of th field that  cancels the bubble and return false to prevent the system onchange functions.

    Can you not use a plugin to achieve what you are trying to do?
    MSCRM Bing'd - http://bingsoft.wordpress.com
    Friday, March 12, 2010 12:23 PM
    Moderator
  • OnChange of owner field can be used only at the stage of creation of record.
    For update form you should use OnSave event handler and make filter by event.Mode (in assign case event.Mode equals 47). Check this url .
    Truth is opened the prepared mind

    My blog (english)
    Мой блог (русскоязычный)
    Friday, March 12, 2010 12:57 PM
    Moderator
  • Hi

    When a owner button (icon) is clicked assignObject ("1088") is called using onshowdialog.
    i.e. onshowdialog="assignObject ("1088")"

    You can bypass this window by overriding ownerid button onshowdialog property.

    Hence "Confirmation Assignment -- Web Page Dialog" will be bypased and "Look up redords -- Web Page Dialog" will be opended.

    On Load():

    document.getElementById('ownerid').onshowdialog = "newpage.html";


    Regards
    Vinoth


    Friday, March 12, 2010 1:37 PM
  • Thanks a lot, Rhett, Andriy and Vinoth for providing your valuable comments. The issue got resolved.

    Friday, March 12, 2010 2:49 PM