Example of adding a ToolbarButton to an Entity in ISV.conf?

Miklos_HollenderMiklos_Hollender Member Posts: 1,598
edited 2007-09-10 in Dynamics CRM
If you have one please paste it here - the complete XML file, not just the snippet.

Whenever I export the ISV.config, remove the examples in the CDATA, add the configuration, root and ISVconfig elements and the toolbar to the entity, it complains about a schema validation in the configuration version = 3.00530.00 line (or something like that, the standard number)

Comments

  • borsicsjborsicsj Member Posts: 32
    Hi Miklos,

    isv.config from crm sdk 3.0 :

    <configuration version="3.0.0000.0">
    <Root>
    <!-- Global Menu Bar at the top of all root level areas -->
    <MenuBar>
    <!-- Custom Menus - between the Goto Menu and the Help Menu -->
    <CustomMenus>
    <Menu Title="ISV">
    <MenuItem Title="New Window" Url="http://www.microsoft.com&quot; />
    <MenuSpacer />
    <!-- A horizontal drop down menu spacer -->
    <SubMenu Title="ISV Tests">
    <MenuItem Title="Modeless Dialog"
    Url="http://www.microsoft.com&quot; WinMode="2" />
    <MenuSpacer />
    <MenuItem Title="Modal Dialog"
    Url="http://www.microsoft.com&quot; WinMode="1" />
    <MenuSpacer />
    <MenuItem Title="Custom JavaScript"
    JavaScript="alert('test');" />
    </SubMenu>
    </Menu>
    </CustomMenus>
    </MenuBar>
    <!--
    Application Level Tool Bar
    -->
    <ToolBar>
    <Button Title="Test" ToolTip="Info on Test"
    Icon="/_imgs/ico_18_debug.gif"
    JavaScript="alert('test');" />
    <ToolBarSpacer />
    <!-- A vertical toolbar spacer -->
    <Button Title="Web Only"
    ToolTip="Web client only"
    Icon="/_imgs/ico_18_debug.gif"
    JavaScript="alert('test');" Client="Web" />
    <Button Title="Outlook Only"
    ToolTip="Outlook only: Also available offline"
    Icon="/_imgs/ico_18_debug.gif"
    JavaScript="alert('test');"
    Client="Outlook" AvailableOffline="true" />
    <Button Title="Both"
    ToolTip="Both Clients: Both Web and Outlook Clients"
    Icon="/_imgs/ico_18_debug.gif"
    JavaScript="alert('test');"
    Client="Web, Outlook"
    AvailableOffline="true" />
    </ToolBar>
    </Root>
    <!-- Microsoft Customer Relationship Management Entities (Objects) -->
    <Entities>
    <Entity name="account">
    <MenuBar>
    <!-- Custom Menus that you may add -->
    <CustomMenus>
    <Menu Title="ISV">
    <MenuItem Title="Coming Soon..."
    Url="http://www.microsoft.com&quot;
    PassParams="0" WinMode="1" />
    <MenuSpacer />
    <SubMenu Title="Sub Test">
    <MenuItem Title="Test Sub 1"
    Url="http://www.microsoft.com&quot; PassParams="1" />
    <MenuSpacer />
    <MenuItem Title="Test Sub 2" />
    </SubMenu>
    <MenuSpacer />
    <MenuItem Title="Coming Soon..."
    Url="http://www.microsoft.com&quot; PassParams="0" />
    <MenuItem Title="Web Only" Client="Web" />
    <MenuItem Title="Outlook Only" Client="Outlook"
    AvailableOffline="true" />
    <MenuSpacer />
    <MenuItem Title="Valid For Update Only" ValidForUpdate="0" />
    <MenuItem Title="Valid For Create Only" ValidForCreate="1" />
    </Menu>
    </CustomMenus>
    </MenuBar>
    <!-- The Account Tool Bar -->
    <ToolBar ValidForCreate="0" ValidForUpdate="1">
    <Button Title="asdf" ToolTip="Info on Test"
    Icon="/_imgs/ico_18_debug.gif"
    Url="http://www.microsoft.com&quot;
    PassParams="1" WinParams="" WinMode="0" />
    <ToolBarSpacer />
    <Button Title="Test" ToolTip="Info on Test"
    Icon="/_imgs/ico_18_debug.gif"
    Url="http://www.microsoft.com&quot;
    PassParams="1" WinParams="" WinMode="1" />
    <Button Title="Web Only"
    ToolTip="Web client only"
    Icon="/_imgs/ico_18_debug.gif"
    JavaScript="alert('test');"
    Client="Web" />
    <Button Title="Outlook Only"
    ToolTip="Outlook only: Also available offline"
    Icon="/_imgs/ico_18_debug.gif"
    JavaScript="alert('test');"
    Client="Outlook" AvailableOffline="true" />
    </ToolBar>
    <!-- The Account Left Nav Bar -->
    <NavBar ValidForCreate="0" ValidForUpdate="1">
    <!--
    Valid Areas Include
    ===================
    Sales
    Marketing
    Service
    Info
    -->
    <NavBarItem Icon="/_imgs/ico_18_debug.gif"
    Title="ISV Default"
    Url="http://www.microsoft.com&quot; Id="navItem" />
    <NavBarItem Icon="/_imgs/ico_18_debug.gif"
    Title="ISV Web Only"
    Url="http://www.microsoft.com&quot;
    Id="navItemWeb" Client="Web" />
    <NavBarItem Icon="/_imgs/ico_18_debug.gif"
    Title="ISV Outlook Only"
    Url="http://www.microsoft.com&quot;
    Id="navItemOutlook" Client="Outlook"
    AvailableOffline="true" />
    <NavBarItem Icon="/_imgs/ico_18_debug.gif"
    Title="ISV Sales"
    Url="http://www.microsoft.com&quot;
    Id="navSalesItem" Area="Sales" />
    <NavBarItem Icon="/_imgs/ico_18_debug.gif"
    Title="ISV Info"
    Url="http://www.microsoft.com&quot;
    Id="navInfoItem" Area="Info" />
    <NavBarItem Icon="/_imgs/ico_18_debug.gif"
    Title="ISV Marketing"
    Url="http://www.microsoft.com&quot;
    Id="navMarketingItem" Area="Marketing" />
    <NavBarItem Icon="/_imgs/ico_18_debug.gif"
    Title="ISV Service"
    Url="http://www.microsoft.com&quot;
    Id="navServiceItem" Area="Service" />
    </NavBar>
    <Grid>
    <MenuBar>
    <ActionsMenu>
    <MenuItem Title="Coming Soon..."
    Url="http://www.microsoft.com&quot; WinMode="1" />
    <MenuSpacer />
    <SubMenu Title="Sub Test">
    <MenuItem Title="Test Sub 1"
    Url="http://www.microsoft.com&quot; />
    <MenuSpacer />
    <MenuItem Title="Test Sub 2" />
    <MenuItem Title="Web Only" Client="Web" />
    <MenuItem Title="Outlook Only"
    Client="Outlook" AvailableOffline="true" />
    </SubMenu>
    <MenuItem Title="Web Only" Client="Web" />
    <MenuItem Title="Outlook Only"
    Client="Outlook" AvailableOffline="true" />
    </ActionsMenu>
    <Buttons>
    <Button Title="Test" ToolTip="Info on Test"
    Icon="/_imgs/ico_18_debug.gif"
    Url="http://www.microsoft.com&quot;
    WinParams="" WinMode="2" />
    <ToolBarSpacer />
    <Button Title="Test" ToolTip="Info on Test"
    Icon="/_imgs/ico_18_debug.gif"
    Url="http://www.microsoft.com&quot;
    WinParams="" WinMode="1" />
    <Button Title="Web Only"
    ToolTip="Web client only"
    Icon="/_imgs/ico_18_debug.gif"
    JavaScript="alert('test');" Client="Web" />
    <Button Title="Outlook Only"
    ToolTip="Outlook only: Also available offline"
    Icon="/_imgs/ico_18_debug.gif"
    JavaScript="alert('test');" Client="Outlook"
    AvailableOffline="true" />
    </Buttons>
    </MenuBar>
    </Grid>
    </Entity>
    <Entity name="contact" />
    <Entity name="lead" />
    <Entity name="opportunity" />
    <Entity name="list" />
    <Entity name="campaign" />
    <Entity name="campaignactivity" />
    <Entity name="campaignresponse" />
    <Entity name="incident" />
    <!-- Case -->
    <Entity name="quote" />
    <Entity name="salesorder" />
    <!-- Order -->
    <Entity name="invoice" />
    <!-- Custom Entities -->
    <!-- <Entity name="myEntity"/> -->
    <!-- End Custom Entities -->
    </Entities>
    <!-- Microsoft Customer Relationship Management Service Management Customization -->
    <ServiceManagement>
    <AppointmentBook>
    <SmoothScrollLimit>2000</SmoothScrollLimit>
    <TimeBlocks>
    <!-- All CSS Class mapping for Service actiivties -->
    <TimeBlock EntityType="4214" StatusCode="1"
    CssClass="ganttBlockServiceActivityStatus1" />
    <TimeBlock EntityType="4214" StatusCode="2"
    CssClass="ganttBlockServiceActivityStatus2" />
    <TimeBlock EntityType="4214" StatusCode="3"
    CssClass="ganttBlockServiceActivityStatus3" />
    <TimeBlock EntityType="4214" StatusCode="4"
    CssClass="ganttBlockServiceActivityStatus4" />
    <TimeBlock EntityType="4214" StatusCode="6"
    CssClass="ganttBlockServiceActivityStatus6" />
    <TimeBlock EntityType="4214" StatusCode="7"
    CssClass="ganttBlockServiceActivityStatus7" />
    <TimeBlock EntityType="4214" StatusCode="8"
    CssClass="ganttBlockServiceActivityStatus8" />
    <TimeBlock EntityType="4214" StatusCode="9"
    CssClass="ganttBlockServiceActivityStatus9" />
    <TimeBlock EntityType="4214" StatusCode="10"
    CssClass="ganttBlockServiceActivityStatus10" />
    <!-- All CSS Class mapping for Appointments -->
    <TimeBlock EntityType="4201" StatusCode="1"
    CssClass="ganttBlockAppointmentStatus1" />
    <TimeBlock EntityType="4201" StatusCode="2"
    CssClass="ganttBlockAppointmentStatus2" />
    <TimeBlock EntityType="4201" StatusCode="3"
    CssClass="ganttBlockAppointmentStatus3" />
    <TimeBlock EntityType="4201" StatusCode="4"
    CssClass="ganttBlockAppointmentStatus4" />
    <TimeBlock EntityType="4201" StatusCode="5"
    CssClass="ganttBlockAppointmentStatus5" />
    <TimeBlock EntityType="4201" StatusCode="6"
    CssClass="ganttBlockAppointmentStatus6" />
    </TimeBlocks>
    </AppointmentBook>
    </ServiceManagement>
    </configuration>

    Hope it helps.
    Brg,

    --
    János Borsics
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Sorry but it doesn't. This is how I started it - removing unnecessary from this one and keeping the button only. Didn't work, always failing on the Configuration line. I guess the main problem is I have no idea what XML entities are mandatory f.e. do I have to keep the Root if it's empty.

    I think I'll just switch to hacker mode and replace the outerHTM of the previous button from JScript.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    hacked in JavaScript:
    function add_toolbar_button(name, id, image, event)
    {
      var toolbar = document.all.mnuBar2.rows(0).cells(0);
      var html = "" +
         "<SPAN tabindex='0' class='menu' style='padding:3px 3px 0px 3px' pl='3' pr='3' title='" + name +
         "' onclick='" + event + 
         "' id='" + id + 
         "'>" + 
         "<DIV class='mnuBtn'>" +
         "<IMG src='" + image  + 
         "' class='mnuBtn'>" + name + "</DIV></SPAN>";
      toolbar.insertAdjacentHTML("beforeEnd", html);
        
    };
    
    function send_mail_button_onclick()
    {  
      location='mailto:?SUBJECT=' + crmForm.all.title.DataValue  +
      ' - '+ crmForm.all.customerid.DataValue[0].name + '&BODY='+location.href;
    };
    
    
    function case_add_linkbtn()
    {                                   
      if (crmForm.FormType==2) //update
      {
         
        add_toolbar_button("Create Link in E-Mail","CreateLinkInEmail","/_imgs/ico_16_138.gif","send_mail_button_onclick()");
      };
    };
    
    
Sign In or Register to comment.