-
Adding a toolbar button to create new, related entities
[unsupported]
One of my current projects has requirements to add toolbar buttons to allow the user to create a new, related Entity such as a phone call or appointment with a click of a button.
Buttons are added to the toolbar by modifying the isv.config.xml and inserting code similar to the following:
<Button Title="Phone Call" ToolTip="Create a phone call" Icon="/_imgs/ico_16_1071.gif" JavaScript="locAddRelatedTo(4210);" />
I would like to point out the JavaScript function locAddRelatedTo(). This will open a new window containing a new CRM Entity. The Entity being created is determined by the parameter passed to the function. The parameter is the ID of the Entity in question. In the above example, 4210 is the Entity ID for the Phone Call Activity. Substitute any valid Entity ID to create a new built-in or custom Entity.
Customization, Dynamics CRM, Unsupported 4,704 views15 responses to “Adding a toolbar button to create new, related entities”
-
Techy News » Blog Archive » Adding a toolbar button to create new, related entities November 9th, 2007 at 09:43
[...] Read the rest of this great post here [...]
-
[...] CRM MVP Mitch Milam blogs about "Adding a toolbar button to create new related entities". One of the very popular features of the Microsoft Dynamics CRM platform is the extensibility support built into the product. Mitch's blog demonstrates that customization doesn't have to be hard. Filed under: Extensibility [...]
-
[...] CRM MVP Mitch Milam blogs about "Adding a toolbar button to create new related entities". One of the very popular features of the Microsoft Dynamics CRM platform is the extensibility support built into the product. Mitch's blog demonstrates that customization doesn't have to be hard. [...]
-
Mitch Milam’s Microsoft Discussions » Blog Archive » Calling a custom JavaScript function from a custom toolbar button November 9th, 2007 at 16:25
[...] 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? [...]
-
Mitch, one weird thing I've found when adding these buttons is that the exact function to call can sometimes be less than intuitive. For example, if you want to add an activity to an opportunity, and you want the activity's "Regarding" field to be pre-populated with the Opportunity, you need to call the locAddActTo(4210) function. You would think the locAddRelatedTo() function would make it related to the parent object, but it doesn't seem to work that way…
-
That is a great point Matt and not one I'm sure I have an answer for.
Mitch
-
Ibrahim April 13th, 2008 at 21:15
Mitch, Awesome post. I have same project regarding same needs (buttons on top).
-
Luis Fernando June 12th, 2008 at 06:00
Valeu, pela ajuda…
Muito bom este teu exemplo -
Sarah July 23rd, 2008 at 11:47
I need to add a phone call button in CRM 4.0. Please can you tell me if this works for CRM 4.0 and if this is the best way.
Thanks
Sarah -
mitch July 24th, 2008 at 11:34
It should work, but I'd have to try it to be sure. I'll try and do that next week sometime.
-
Jordan July 16th, 2009 at 12:24
I am brand new to CRM.
I tried this in 4.0 and I cannot get it to work. Did you get a chance to test it?
Where does one find these functions?
-
mitch July 16th, 2009 at 12:55
Jordan,
It is not the function that is incorrect, it is the parameters on the Button that are different from CRM 3.0 and 4.0. Look in the SDK for the Button element and see how Titles and Tooltips are now handled.
Mitch
-
Jordan July 16th, 2009 at 14:13
Mitch,
I set it up like the button examples in the ISVConfig:
and the page loads with an error and the button does not work. If I change the javascript to:
JavaScript="alert('Go to New Activity > Phone Call ');"
It works as expected.
Ideas?
Jordan
-
Jordan July 16th, 2009 at 16:58
Mitch, I think I discovered my problem.
I am not intending to relate the call to anything. I just want to create a new call. Where do I find the function for that?
Jordan
-
How to add a button to a entity form, and create a new related CRM record | Dynamo with Dynamics CRM February 25th, 2010 at 18:18
[...] Thanks to Mitch Milam's blog for pointing me in the right direction. February 25th, 2010 | Tags: button, CRM 4.0, ISV, [...]
Leave a reply
-



