-
Calling a custom JavaScript function from a custom toolbar button
Speaking of toolbar buttons. Another common practice is to add a toolbar button that will perform some complex operation in JavaScript. Since you generally don't want the JavaScript itself inside your isv.config.xml file, you need a place to put it where it's easily maintained. How about in the Form's OnLoad event?
Buttons are added to the toolbar by modifying the isv.config.xml and inserting code similar to the following:
<Button Title="DoIt" ToolTip="Do something interesting" Icon="/_imgs/ico_16_1071.gif" JavaScript="MyCustomFunction();" />
Inside the Form's OnLoad event, we declare our MyCustomFunction() like this:
1: MyCustomFunction = function()2: {3: alert("we're doing something interesting here...");
4: }By adding the function to the OnLoad event, you centralize your JavaScript functions which will usually decrease your maintenance requirements since all of the code is in one place. Also, since we're working inside the form, we have access to the Form's attributes as we normally would.
Customization, Dynamics CRM 2,424 views3 responses to “Calling a custom JavaScript function from a custom toolbar button”
-
Techy News » Blog Archive » Calling a custom JavaScript function from a custom toolbar button November 9th, 2007 at 17:35
[...] Read the rest of this great post here [...]
-
Calling a custom JavaScript function from a custom toolbar button by hgwebhost November 10th, 2007 at 22:44
[...] read more here [...]
-
hosthg » Blog Archive » Calling a custom JavaScript function from a custom toolbar button November 13th, 2007 at 09:38
[...] full story here [...]
Leave a reply
-



