locked
adding a button to an entity form RRS feed

  • Question

  • Hi,
    I wanted to know how to add a button to the form of an entity and call jscript function in the onclick event.
    Wednesday, September 30, 2009 9:24 AM

Answers

All replies

  • Hi.

    There are two ways I know:
    1. Trough ISV.Config. Check this url . Sample .
    2. Trough JavaScript. Check this url .
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, September 30, 2009 9:40 AM
    Moderator
  • You have two possibilities:

    1- supported way : create an Iframe and put a custom web page with the button

    2-unsupported way : on the onload event, update the HTML DOM to add a button

    Let me know if you need some example for updating the DOM
    My blog : http://mscrmtools.blogspot.com You will find: Form Javascript Manager (export/import javascript from forms) ISV.Config Manager (graphical ISV.config edition - export/import) View Layout replicator (customize one view and replicate to others) And others (use tool tag on my blog)
    Wednesday, September 30, 2009 9:41 AM
    Moderator
  • I tried by exporting the customization, made change to the xml and tried to import the xml.But I got the following error:
    "either the file is could not be uploaded or it is not a valid customization file".
    Why is it?

    Wednesday, September 30, 2009 12:04 PM
  • Hi.

    Could you paste here ISV.Config you try to import?
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, September 30, 2009 12:04 PM
    Moderator
  • Hi,
    the node that i changed was this:
    old:
    <entity name="contact"/>
    new:

    <

     

     

    Entity name="contact" >
    <
    MenuBar> </MenuBar>
    <
    ToolBar ValidForCreate="1" ValidForUpdate="0">
    <
    Button Icon="/_imgs/ico_18_debug.gif" Javascript="alert('hello');" Client="Web">
    <
    Titles>
    <
    Title LCID="1033" Text="CustomerFill" />
    </
    Titles>
    <
    ToolTips>
    <
    ToolTip LCID="1033" Text="Fills cust id when clicked" />
    </
    ToolTips>
    </
    Button>
    </
    ToolBar>
    </
    Entity>

    Wednesday, September 30, 2009 12:19 PM
  • Remove the MenuBar item

    Replace Javascript by JavaScript

    My blog : http://mscrmtools.blogspot.com You will find: Form Javascript Manager (export/import javascript from forms) ISV.Config Manager (graphical ISV.config edition - export/import) View Layout replicator (customize one view and replicate to others) And others (use tool tag on my blog)
    Wednesday, September 30, 2009 12:36 PM
    Moderator
  • Hi.

    Problem in line

    < Button Icon = " /_imgs/ico_18_debug.gif " Javascript = " alert('hello'); " Client = " Web " >

    must be JavaS cript, like:

    < Button Icon = " /_imgs/ico_18_debug.gif " JavaScript = " alert('hello'); " Client = " Web " >
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, September 30, 2009 12:36 PM
    Moderator
  • Remove the MenuBar item
    My blog : http://mscrmtools.blogspot.com You will find: Form Javascript Manager (export/import javascript from forms) ISV.Config Manager (graphical ISV.config edition - export/import) View Layout replicator (customize one view and replicate to others) And others (use tool tag on my blog)

    FYI it works with MenuBar node. Problem in Button's attribute JavaScript.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, September 30, 2009 12:37 PM
    Moderator
  • Hi,

    I made the correction. After importing, i published the customization but now i am not able to see the new button that i added. Why is it?

    Wednesday, September 30, 2009 1:07 PM
  • Two settings to look:

    Does your security role allows you to see ISV extensions?

    Does the general settings of the CRM Server allow to display ISV button in web client?
    My blog : http://mscrmtools.blogspot.com You will find: Form Javascript Manager (export/import javascript from forms) ISV.Config Manager (graphical ISV.config edition - export/import) View Layout replicator (customize one view and replicate to others) And others (use tool tag on my blog)
    Wednesday, September 30, 2009 1:11 PM
    Moderator
  • Hi.


    This Button is available only in web client and only at the stage of record creation.

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, September 30, 2009 1:11 PM
    Moderator
  • Yeah I opened the record creation form yet i was not able to see the change. My security role is of System Administrator.
    Wednesday, September 30, 2009 1:24 PM
  • And what about general settings

    Settings -> Administration -> General Settings -> Customization tab -> Custom menu and toolbar section
    My blog : http://mscrmtools.blogspot.com You will find: Form Javascript Manager (export/import javascript from forms) ISV.Config Manager (graphical ISV.config edition - export/import) View Layout replicator (customize one view and replicate to others) And others (use tool tag on my blog)
    Wednesday, September 30, 2009 1:37 PM
    Moderator
  • It has Web Application as the place which will show the customization.
    Wednesday, September 30, 2009 1:45 PM
  • Do you have outlook client for CRM installed on computer you use?
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, September 30, 2009 1:48 PM
    Moderator
  • No, I have not installed.
    Wednesday, September 30, 2009 1:49 PM
  • What is the language of your CRM deployment?
    My blog : http://mscrmtools.blogspot.com You will find: Form Javascript Manager (export/import javascript from forms) ISV.Config Manager (graphical ISV.config edition - export/import) View Layout replicator (customize one view and replicate to others) And others (use tool tag on my blog)
    Wednesday, September 30, 2009 1:52 PM
    Moderator
  • Very strange... Try to make iisreset from command prompt (to reset internet information service) and delete temporary files in your browser.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Wednesday, September 30, 2009 1:53 PM
    Moderator
  • When I imported the customization, I imported only contact entity since I had made changes only to that entity. That should not matter right?
    Wednesday, September 30, 2009 2:16 PM
  • You have to import ISV.Config, not the contact entity.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Marked as answer by princess_me Wednesday, September 30, 2009 2:45 PM
    Wednesday, September 30, 2009 2:17 PM
    Moderator
  • Thanks a lot :) It is working now.
    Wednesday, September 30, 2009 2:45 PM
  • Hi,
    Yesterday you sent me a link where i can create a button on the crm form using javascript. I put it in the onload event of the form. Is that the right way to do because I got an error saying that the object being referenced is not initialized etc.
    Thursday, October 1, 2009 7:00 AM
  • Hi.

    Have you added attribute new_button to entity and placed it of the form?
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Thursday, October 1, 2009 7:11 AM
    Moderator
  • Yeah I added the new_button entity as a varchar and then in the onload jscript function of the entity.
    Thursday, October 1, 2009 7:25 AM
  • Yeah I added the new_button entity as a varchar and then in the onload jscript function of the entity.

    Is new_button attribute or is new button entity?

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Thursday, October 1, 2009 7:27 AM
    Moderator
  • new_button is the attribute. In the onload I added the javascript code which was there in the site you told me.
    Thursday, October 1, 2009 7:34 AM
  • This solution works ideal for me. Check screenshots:

    Attribute creation
    Place this attribute to form
    Add script from site to OnLoad event handler
    Testing (Preview Create Form)

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Marked as answer by princess_me Thursday, October 1, 2009 9:55 AM
    Thursday, October 1, 2009 7:46 AM
    Moderator
  • Yeah working now.
    Thursday, October 1, 2009 9:55 AM