tag:blogger.com,1999:blog-45490455119449975252024-03-12T22:58:48.987-07:00hari.mallampatihari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.comBlogger119125tag:blogger.com,1999:blog-4549045511944997525.post-78243190528521707082014-02-04T23:27:00.001-08:002014-02-04T23:27:21.882-08:00New JavaScript methods in Microsoft Dynamics CRM 2013<div dir="ltr" style="text-align: left;" trbidi="on">
<strong style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> Microsoft Dynamics CRM 2013</strong><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"> is providing some exciting new methods we can use with the JavaScript SDK on the entity forms, such as :</span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; color: maroon; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Easier way to set the form dirty</span></li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; color: maroon; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Custom lookup filters</span></li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; color: maroon; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Displaying form notifications as well as field specific notifications. </span></li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Context</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.context.client.getClient()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Returns “Outlook”, “Web”, or “Mobile”</li>
</ul>
</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.context.client.getClientState()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Returns “Online” or “Offline”</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.context.isOutlookOnline and isOutlookClient are now deprecated</strong></li>
</ul>
</li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Data</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.data.refresh()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Asynchronously refresh data on form without reloading the page</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Can pass in a callback to execute on error or success</li>
</ul>
</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.data.save()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Asynchronously save the form</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Can pass in a callback to execute on error or success</li>
</ul>
</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.data.getIsValid()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Returns a boolean telling whether the form can be saved or not</li>
</ul>
</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.data.setFormDirty()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Sets the form as dirty</li>
</ul>
</li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Entity</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.data.entity.getPrimaryAttributeValue()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Returns a string value of the primary attribute for the entity</li>
</ul>
</li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">UI</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.ui.setFormNotification()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Takes in a string value to set a form notification with the passed in string</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Pass in “ERROR”, “INFORMATION” or “WARNING” to dictate the type of notification</li>
</ul>
</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><a href="http://dynamics.co.il/crm-2013-new-client-api/" style="border: 0px; color: #b41423; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: none 0px; padding: 0px; vertical-align: baseline;"><img alt="crm 2013" border="0" height="216" src="http://sonomapartners.typepad.com/.a/6a00d8341e71de53ef019aff8f9e84970c-pi" style="border: 0px currentcolor; max-width: 100%;" title="crm 2013" width="482" /></a></li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.ui.clearFormNotification()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Clears the form notification</li>
</ul>
</li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">All Controls</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.getControl(“new_name”).setNotification(“Field specific notification”)<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Sets a notification specific to the field</li>
</ul>
</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><a href="http://dynamics.co.il/crm-2013-new-client-api/" style="border: 0px; color: #b41423; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: none 0px; padding: 0px; vertical-align: baseline;" title="crm 2013"><img alt="crm 2013" border="0" height="124" src="http://sonomapartners.typepad.com/.a/6a00d8341e71de53ef019aff8f9e92970c-pi" style="border: 0px currentcolor; max-width: 100%;" title="crm 2013" width="350" /></a></li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.getControl(“new_name”).clearNotification()<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Clears the field specific notification</li>
</ul>
</li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Number Fields</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.<span style="border: 0px; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Page.getAttribute(“new_precision”).setPrecision(2)</span><ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; color: black; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Override field’s precision</span></li>
</ul>
</li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Date Fields</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.getControl(“createdon”).setShowTime(true)<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Controls whether to show the time for a date field</li>
</ul>
</li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Lookup Fields</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.getControl(“ownerid”).addCustomFilter(fetchFilter, entityType)<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Applies a custom filter to the lookup view</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">entityType is optional and if it is not passed it will default to all entity views</li>
</ul>
</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.getControl(“ownerid”).addPreSearch(handler)<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">triggers right before a lookup dialog pops open</li>
</ul>
</li>
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Page.getControl(“ownerid”).removePreSearch(handler)<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">removes event handler set from the addPreSearch method</li>
</ul>
</li>
</ul>
<span style="background-color: white; border: 0px; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Utility</strong></span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px;"></span><br />
<ul style="background-color: white; border: 0px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 30px; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Xrm.Utility.openWebResourceDialog(webResourceName, webResourceData, width, height)<ul style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; list-style: square; margin: 0px 0px 10px 2.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">opens a specified HTML web resource as a dialog</li>
</ul>
</li>
</ul>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-1461560098508470352013-12-10T00:30:00.001-08:002013-12-10T00:30:15.339-08:00Restrict Auto Save in MSCRM 2013<div dir="ltr" style="text-align: left;" trbidi="on">
function stopAutoSave(context) {<br />
var saveEvent = context.getEventArgs();<br />
if (saveEvent.getSaveMode() == 70) { //Form AutoSave Event<br />
saveEvent.preventDefault(); //Stops the Save Event<br />
}<br />
} </div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-29853676767003846142013-12-08T22:34:00.002-08:002013-12-08T22:34:36.674-08:00Creste Email using CRM 2011 Plug In<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
private void SendEmail(IOrganizationService service, Guid recieverUserId, Guid senderUserId, Guid regardingObjectId, string emailBody, string emailSubject)</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
{</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
Entity email = new Entity();<br style="margin: 0px; padding: 0px;" />email.LogicalName = “email”;</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
//Set regarding object property (i.e. The entity record, which u want this email associated with)</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
EntityReference regardingObject = new EntityReference(“{entity_name}”, regardingObjectId);<br style="margin: 0px; padding: 0px;" />email.Attributes.Add(“regardingobjectid”,regardingObject);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
//Defining Activity Parties (starts)</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
EntityReference from = new EntityReference(“systemuser”, senderUserId);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
EntityReference to = new EntityReference(“systemuser”,recieverUserId);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
//Derive from party</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
Entity fromParty = new Entity(“activityparty”);<br style="margin: 0px; padding: 0px;" />fromParty.Attributes.Add(“partyid”,from);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
//Derive to party</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
Entity toParty = new Entity(“activityparty”);<br style="margin: 0px; padding: 0px;" />toParty.Attributes.Add(“partyid”, to);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
EntityCollection collFromParty = new EntityCollection();<br style="margin: 0px; padding: 0px;" />collFromParty.EntityName = “systemuser”;<br style="margin: 0px; padding: 0px;" />collFromParty.Entities.Add(fromParty);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
EntityCollection collToParty = new EntityCollection();<br style="margin: 0px; padding: 0px;" />collToParty.EntityName = “systemuser”;<br style="margin: 0px; padding: 0px;" />collToParty.Entities.Add(toParty);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
email.Attributes.Add(“from”,collFromParty);<br style="margin: 0px; padding: 0px;" />email.Attributes.Add(“to”, collToParty);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
//Defining Activity Parties (ends)</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
//Set subject & body properties<br style="margin: 0px; padding: 0px;" />email.Attributes.Add(“subject”,emailSubject);<br style="margin: 0px; padding: 0px;" />email.Attributes.Add(“description”, emailBody);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
//Create email activity</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
Guid emailID = service.Create(email);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
//Sending email</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
SendEmailRequest reqSendEmail = new SendEmailRequest();<br style="margin: 0px; padding: 0px;" />reqSendEmail.EmailId = emailID;//ID of created mail<br style="margin: 0px; padding: 0px;" />reqSendEmail.TrackingToken = “”;<br style="margin: 0px; padding: 0px;" />reqSendEmail.IssueSend = true;</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
SendEmailResponse res = (SendEmailResponse)service.Execute(reqSendEmail);</div>
<div style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;">
}</div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-58585593916335811762013-12-04T02:50:00.002-08:002013-12-04T02:50:43.002-08:00how to refresh parent ms crm 2011 form on child aspx custom page close?<div dir="ltr" style="text-align: left;" trbidi="on">
<strong>Issue:</strong><br /><br />I have button custom button in contract entity ribbon area. (MS CRM 2011).<br /><br />In that button click I am opening an .aspx page through “window.showModalDialog”.<br /><br />
In the .aspx I want to access the contract entity record some attributes to set values for it.<br /><br />
But I am unable to access the CRM from.<br /><br />
I have tried like <br />
window.parent.opener.Xrm.Page.data.entity.attributes.get('iaah_cohortyesclicked').setValue('yes');<br /><br />window.top.opener.document.getElementById("'iaah_cohortyesclicked'").value = "value";<br /><br />
It is not working.<br />
<br />
<br />
<strong>Solution:</strong><br />
<br />In the contract entity javascript where I am opening the window.showModalDialog <br />
<br />Now I am passing the CRM form windows object as parameter to showModalDialog.<br /><br />
//In javascript<br /><br />window.showModalDialog(strSourceURL,window, "dialogHeight:200px;dialogWidth:550px;center:yes; resizable:0;maximize:0;minimize:0;status:no;scroll:no");<br /><br />
Before I was opening the dialog as<br /><br />
window.showModalDialog(strSourceURL,null, "dialogHeight:200px;dialogWidth:550px;center:yes; resizable:0;maximize:0;minimize:0;status:no;scroll:no");<br /><br />
<br />Instead of null I am passing window.<br /><br />
<br />Now I can able to access the CRM form attributes in my .aspx page.<br /><br />Like<br /><br />var parentWindow = window.dialogArguments;<br /><br />parentWindow.Xrm.Page.data.entity.attributes.get('iaah_cohortyesclicked').setValue('yes');<br />
<br /> </div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-43059052581097821262013-12-02T01:02:00.001-08:002013-12-02T01:02:12.355-08:00MSCRM 2013 Actions<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://community.dynamics.com/crm/b/crminogic/archive/2013/09/27/introduction-to-actions-in-crm-2013.aspx">http://community.dynamics.com/crm/b/crminogic/archive/2013/09/27/introduction-to-actions-in-crm-2013.aspx</a></div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-31284070438141584082013-12-01T20:59:00.002-08:002013-12-01T20:59:41.889-08:00CRM 2013 Custom Actions <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;">
<b><span style="font-family: "Times New Roman","serif"; font-size: 24pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN; mso-font-kerning: 18.0pt;"></span></b><span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"><o:p></o:p></span> </div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">CRM 2013
adds a new handy feature called Custom Actions. Custom Actions provide the
ability for non-developer administrators to write reusable modules of logic
that developers can trigger through client-side or server-side code. Custom
Actions are built using a similar UI as workflows with the same capabilities.
The actions are run synchronously and can take in parameters as well as return
values. Custom Actions can be pretty powerful and are a great way to share
logic between both JavaScript and plugins. Below is a great example we came up
with to show how we can replace a 2011 style configuration entity with 2013
Custom Actions. <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">In CRM
2011, if you need to reference values in code that would change between
deployments, the best practice is to create a new entity (typically called
Configuration) and add necessary attributes for configurable values such as a
“Server URL” of an integration web service. The sole purpose of this entity is
to hold one record that would contain the correct values that your custom code
can reference, usually for integration purposes. The downside to this approach
is that it adds overhead by needing to create a whole entity that will only
ever have one record and you need to manually import that record into your
target environment. Below is a step-by-step guide on how we can avoid a
configuration entity in CRM 2013 using Custom Actions.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">In CRM
2013, go to Settings and then Processes. Create a new Process and set the
Category to “Action” and the Entity to “None (global)”.<o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioUgo1v6AnYNwfFGPabDYRT9t74tDii86OITdsPrLovL3xurVaMB-cxbskRH7RfceonhMSUHEcvDZ6YWrfkXGsZ3EmncZx_pXQTHn6ZkwxXZC5jNZmhfRtKU385rOLuvAr_bg0mwWuOZmL/s1600/Action+congfig1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioUgo1v6AnYNwfFGPabDYRT9t74tDii86OITdsPrLovL3xurVaMB-cxbskRH7RfceonhMSUHEcvDZ6YWrfkXGsZ3EmncZx_pXQTHn6ZkwxXZC5jNZmhfRtKU385rOLuvAr_bg0mwWuOZmL/s320/Action+congfig1.png" width="320" /></a></div>
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<a href="http://sonomapartners.typepad.com/.a/6a00d8341e71de53ef019b00f3c2c3970d-pi"><span style="color: blue; font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN; mso-no-proof: yes; text-decoration: none; text-underline: none;"><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype></span></a><span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"><o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Once the
process is created, click the plus icon to add a new argument and set the name
to the configuration value such as “ServerUrl”. Set the Type appropriately
based on your value and set the Direction to Output. Do this for each
configuration value needed.<o:p></o:p></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX3hfW9zXlaxTEDkSsr-C-kGzXxpeVq7CALSp2KVxElveX8yvAqBbPkkOm12O8rn9vS2JnHdyrOx1JnpgQwcHcN5tBCovv2JZ6ulalItTOEIaIzU0u116ZJWoKEjp3mYtpc9z_bCX6HIVW/s1600/Action+congfig1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a><br /></div>
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<a href="http://sonomapartners.typepad.com/.a/6a00d8341e71de53ef019b00f364ca970b-pi"><span style="color: blue; font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN; mso-no-proof: yes; text-decoration: none; text-underline: none;"></span></a><span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"><o:p></o:p></span><br /></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Scroll
down to the designer and click “Add Step” and then “Assign Value”.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<a href="http://sonomapartners.typepad.com/.a/6a00d8341e71de53ef019b00f3c2dc970d-pi"><span style="color: blue; font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN; mso-no-proof: yes; text-decoration: none; text-underline: none;"></span></a><span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"><o:p></o:p></span><br /></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Click
Properties and in the new dialog window, type in the value for your
configuration attribute.</span><a href="http://sonomapartners.typepad.com/.a/6a00d8341e71de53ef019b00f3c2e8970d-pi"><span style="color: blue; font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN; mso-no-proof: yes; text-decoration: none; text-underline: none;"></span></a><span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"> <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Now save
and activate your new custom action.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">The
custom action is now live so we can use the CrmSvcUtil to generate an SDK
message for the action so that we can easily use it with server-side code. You
can use the CrmSvcUtil the same way in 2013 as you did in 2011 but you will
need to add the “/a” flag to generate an SDK message for your custom actions.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<b><i><span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Note: You
will need the latest CrmSvcUtil which is provided </span></i></b><span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=40321"><b><i><span style="color: blue;">here</span></i></b></a><b><i> in the 2013 SDK.</i></b><o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">CrmSvcUtil
/url:<a href="http://server/org/XRMServices/2011/Organization.svc"><span style="color: blue;">http://server/org/XRMServices/2011/Organization.svc</span></a>
/out:Demo.cs <br />
/serviceContextName:DemoContext /namespace:Demo.Model /a<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Now we
can reference the new_GetConfigurationValuesRequest and execute it to get the
ServerUrl value from CRM. Even though we specified the custom action as global,
we are still required to pass in an EntityReference otherwise CRM will throw an
error. Our workaround for this is to pass in the ID of the current user. <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">var
request = <br />
new new_GetConfigurationValuesRequest() <br />
{ <br />
Target = new EntityReference("systemuser", GetCurrentUserId()), <br />
}; <o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">var
response = (new_GetConfigurationValuesResponse)_service.Execute(request); <br />
var url = response.ServerUrl;<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="font-family: "Times New Roman","serif"; font-size: 12pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">So there
you have it! Executing this request returns “http://server” that I had set in
the custom action and now we can use it to replace a configuration entity. As
you can see, custom actions can be pretty powerful. One improvement we’re
hoping for in the future is to allow custom actions to execute custom code,
similar to a workflow assembly. This would allow developers to easily kick off
server-side code from JavaScript.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0cm 0cm 10pt;">
<o:p><span style="font-family: Calibri;"> </span></o:p></div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-11017175931745166262013-11-28T20:52:00.005-08:002013-11-28T20:53:02.663-08:00How to get get and Set the Party list in Javascript:<div dir="ltr" style="text-align: left;" trbidi="on">
<strong>To retrieve values by jscript:</strong> <br /><br />
var partylistItem = new Array;<br />//get the items/values in a field named"resources"<br /><br />partylistItem = Xrm.Page.getAttribute("resources").getValue();<br /><br /><strong>To set values by jscript : </strong><br />
<strong>To set values we also need to get an array.</strong><br /> var partlistset= new Array();<br />partlistset[0] = new Object();<br />partlistset[0].id = id; // provide a guid type value<br />partlistset[0].name = name; // provide a suitable name<br />partlistset[0].entityType = entityType; // provide the entity name of the item ie account/ contact etc .<br />Xrm.Page.getAttribute("resource").setValue(partlistset); </div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-18518297876720040912013-11-28T20:51:00.001-08:002013-11-28T20:51:58.781-08:00How to get the Contact Guids from a PartyList in a Plugin?<div dir="ltr" style="text-align: left;" trbidi="on">
EntityCollection Recipients; <br />Entity entity = (Entity) context.InputParameters["Target"]; <br />
<br />IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); <br />IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); <br />
Content = entity.GetAttributeValue<String>("subject"); <br />Recipients = entity.GetAttributeValue<EntityCollection>("to"); <br />
for (int i = 0; i < Recipients.Entities.Count; i++)<br /> {<br /> ActivityParty ap = Recipients[i].ToEntity<ActivityParty>();<br />
string contactid = ap.PartyId.Id.ToString(); <br />
Contact c = (Contact) service.Retrieve(Contact.EntityLogicalName,ap.PartyId.Id,new ColumnSet(new string[]{"mobilephone"}));<br /> string mobilephone = c.MobilePhone;<br />
//Do something with the mobile phone nr<br />
<br />} </div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-54079067936375375352013-10-11T08:11:00.003-07:002013-10-11T08:11:42.335-07:00DYNAMICS CRM IN 2014<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="color: #51657f; font-family: Oxygen, sans-serif; font-size: 1.8em; font-weight: normal; margin: 35px 0px 4px 9px; padding: 0px; text-transform: uppercase;">
<br /></h2>
<div style="color: #666666; font-family: Verdana, Geneva, sans-serif; font-size: 1.3em; line-height: 18px; margin-bottom: 15px; margin-left: 9px; margin-top: 15px; padding: 0px; width: 890.140625px;">
Looking ahead to 2014 with the next release due in Q1 (codenamed Mira), Microsoft have indicated their CRM roadmap includes:</div>
<div style="color: #666666; font-family: Verdana, Geneva, sans-serif; font-size: 1.3em; line-height: 18px; margin-bottom: 15px; margin-left: 9px; margin-top: 15px; padding: 0px; width: 890.140625px;">
• Marketing Pilot Integration – to connect mid-market and enterprise level marketing automation with CRM including multi-channel campains<br />• Netbreeze Integration – connecting social listening and monitoring with CRM to analysis social sentiment among customers<br />• Enhancements to Microsoft Lync & Skype integration<br />• Case management and service level agreement enhancements<br />• Extended mobile device support</div>
<br /></div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-55357278011876180412013-10-11T08:09:00.003-07:002013-10-11T08:09:47.799-07:00MSCRM 2013 Heighlights<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; border: 0px; color: #303131; font-family: 'Segoe UI', Segoe, Arial !important; line-height: 26px; margin-bottom: 12px; padding: 0px; vertical-align: baseline;">
<br /></div>
<ul style="background-color: white; border: 0px; color: #333333; font-family: 'Segoe UI', Segoe, Arial !important; list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 40px; padding: 0px; vertical-align: baseline;">
<li style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Redesigned User Experience</span>: Cleaner, faster, more intuitive interfaces with no pop ups or flipping from one application to the next.</li>
<li style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Process Agility</span>: Agile process guidance so you can respond to rapidly changing business needs.</li>
<li style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">CRM on the Go:</span> New Windows 8 and iPad mobile applications that make your sales team smarter no matter where they are by delivering a seamless experience across the web and devices.</li>
<li style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Social in Context</span>: Work across boundaries to create the right customer experiences with the enterprise power of Yammer.</li>
<li style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Base and Extension Tables</span> - If you have been working with CRM in the past you are probably aware of the table splitting for each entity within CRM. With CRM 2013, the extension tables will be merged during the upgrade.</li>
<li style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Server-side Synchronization</span> - This new feature within CRM 2013 will allow administrators to easily manage the sync of email, appointments, tasks and contacts between versions of CRM and Exchange.</li>
<li style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; font-size: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Access Teams</span> - With the new feature of record-based Access Teams, you can add a user to the record and give them access.</li>
</ul>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-78036136409891734802013-10-11T05:34:00.000-07:002013-10-11T05:34:18.099-07:00MSCRM 2013 Image Data Types SDk<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<ul style="text-align: left;">
<li>You can access images via a URL. The URL of the image is a read only value available via the SDK off of the Image as an absolute address. Image URLs behave in a similar fashion to Web Resources and Attachments. The primary difference is that images are returned as binary data and Web Resources and Attachments are returned as base-64 encoded MIME types.</li>
<li>ImageAttributeMetadata is being added to the MetadataService class. This class inherits from AttributeMetadata and represents the metadata for an attribute of type Image</li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJvP3tqaoJOsz1M2WfJVtwHqXifCFcXoOu7Azdpw2wKWUswXHeAYEdhDNUCMwhhQWbEN2rZ6KQM2DkaQFaIfwQpWIRjjNdYg47xLR28-PkUXcwsr95743lFDhHc1Ek-Evt_idOVVTRjwUA/s1600/Image+SDK.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJvP3tqaoJOsz1M2WfJVtwHqXifCFcXoOu7Azdpw2wKWUswXHeAYEdhDNUCMwhhQWbEN2rZ6KQM2DkaQFaIfwQpWIRjjNdYg47xLR28-PkUXcwsr95743lFDhHc1Ek-Evt_idOVVTRjwUA/s640/Image+SDK.bmp" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul style="text-align: left;">
<li>Images can be returned as part of FetchXML queries or RetrieveMultiple calls. There will be an option to return binary data, URL, or both.</li>
<li>Binary data must be requested explicitly. A query that specifies “All” fields would only return the image URL. This accounts for the scenario where a user inadvertently queries all fields on an entity with a large number of images.</li>
<li>Microsoft Dynamics CRM for Outlook does not have direct support for images in CRM 2013 so images will not be synced. Image fields would be ignored in query results and offline view filters.</li>
</ul>
<br />
<div>
<br /></div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-47703938775269922442013-10-11T05:28:00.001-07:002013-10-11T05:34:18.097-07:00MSCRM 2013 Image Data type Storage<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<ul style="text-align: left;">
<li>On upload via the web application or SDK, images are validated, resized, and stored as a common binary data format in the CRM database.</li>
<li>Regardless of upload format, all images are all formatted to JPG on create or update. On average, this puts most images at about 5k at max.</li>
<li> The uploaded image is always resized to the minimum size necessary to support CRM 2013 and a smaller sized copy with the same aspect ratio as the original gets stored to the database.</li>
<li>The bounding box in CRM 2013 is hardcoded for all image fields: 144pixels x 144pixels. This value will be stored in attribute metadata as Height and Width</li>
</ul>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-3652445505582717502013-10-11T05:27:00.001-07:002013-10-11T05:34:18.092-07:00MSCRM 2013 Image Data Type Data Modeling <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin: 0in 0in 2.9pt 0.25in;">
</div>
<ul style="text-align: left;">
<li><span style="font-family: Cambria, serif;">The display name can be set for images but SchemaName is always “entityImage” for any image-enabled entities and cannot be changed. </span></li>
<li><span style="font-family: Cambria, serif;">The image data type is not searchable. </span></li>
<li><span style="font-family: Cambria, serif;">A PrimaryImageAttribute metadata has been added to the entity. </span></li>
<li><span style="font-family: Cambria, serif;">Only a single image attribute can be defined per OOB/custom entities. This helps keep storage in check especially for CRM online customers. </span></li>
<li><span style="font-family: Cambria, serif;">PrimaryImageAttribute is set by default to the single “entityimage” attribute when it gets added to a custom entity. This is used to determine what image should be displayed in the header of the form. Note, that the grid does not display these images since that would require a smaller icon. </span></li>
<li><span style="font-family: Cambria, serif;"> If there are no image attributes on the specific entity OR the system customizer has selected not to display any image for the entity, the PrimaryImageAttribute value would be set to [None]. </span></li>
</ul>
<br />
<div class="MsoNormal" style="margin: 0in 0in 2.9pt 0.25in;">
<br /></div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-42047490560878317732013-10-11T05:22:00.003-07:002013-10-11T05:34:18.094-07:00MSCRM 2013 Image Data Type<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="Default">
<span style="font-size: 11.0pt;">In CRM 2011, images are stored
in notes as MIME encoded text. As a result, images get converted to a
displayable format for every read and no pre-cached thumbnails exist. In CRM
2013, images are being introduced as a first class data type. You can now add
images as a field, capture/store images and improve query operations on images.
<o:p></o:p></span></div>
<div class="MsoNormal">
You can capture and maintain images for User Profile,
Contacts and Leads, and Account logos.</div>
<div class="Default">
<br /></div>
<div class="Default">
<span style="font-size: 11.0pt;"><b>Data Modelling </b><o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 2.2pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Image data type
as a field type to the application customization experience. <o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Support for only
one Image field per entity. <o:p></o:p></span></div>
<div class="Default">
<span style="font-size: 11.0pt;"><b>Storage </b><o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 2.3pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Image stored as
binary data in the CRM database. <o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Resize images
server-side to conserve storage space and improve performance. <o:p></o:p></span></div>
<div class="Default">
<span style="font-family: Wingdings; font-size: 11.0pt; mso-bidi-font-family: Wingdings;"> § </span><span style="font-size: 11.0pt;">Original
image uploaded not saved. <o:p></o:p></span></div>
<div class="Default">
<span style="font-size: 11.0pt;"><b>SDK </b><o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">CRUD Operations <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 2.3pt;">
<span style="font-family: Wingdings; font-size: 11.0pt; mso-bidi-font-family: Wingdings;"> § </span><span style="font-size: 11.0pt;">Support
standard CRUD operations of Images the same as any other CRM data type. <o:p></o:p></span></div>
<br />
<div class="Default">
<span style="font-family: Wingdings; font-size: 11.0pt; mso-bidi-font-family: Wingdings;"> § </span><span style="font-size: 11.0pt;">Reference images via URL- ability to include URL and
binary data in a RetrieveMultiple or FetchXML
call. <o:p></o:p></span></div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-61104483817282126222013-10-11T05:18:00.003-07:002013-10-11T05:18:33.861-07:00MSCRM 2011 Customizable Tooltips<div dir="ltr" style="text-align: left;" trbidi="on">
In CRM 2011, tool tips are minimal and typically repeat the display name attribute of the field. These type of tool tips are useful for unlabeled UI, however most form fields have labels assigned to them and users need more information when entering or selecting data. Explanatory tooltips provide helpful text to address known user questions, explain terminology or concepts, and help end-users make good decisions to stay on task.<br />
<b><br /></b>
<b>In CRM 2013, custom tooltips aim to improve the user experience by:</b><br />
<br />
<ul style="text-align: left;">
<li><b> Providing information on how to use and complete forms, right on the page.</b></li>
<li><b>Allowing organizations to display their business-specific information and processes to their users right in the CRM forms.</b></li>
</ul>
<br />
The system customizers can update tool tips when they are customizing an entity or entity attribute. The following points are to be noted:<br />
<br />
<b>Attribute Tool Tips</b><br />
You can display entity attribute “Description” as tool tips on fields, buttons, etc. on existing forms for customizable entities. This will work against OOB and custom attributes.<br />
<br />
<b>Form Tool Tips</b><br />
You can define tool tips to be displayed and the browser determines how the tool tip is displayed and for how long it would get displayed.<br />
<br />
<b>Rewritten Descriptions for Use as Tooltips – Refresh Forms</b><br />
Specifically for Refresh Forms: All descriptions that can be displayed on the forms have now been rewritten for use as customizable tooltips.<br />
<br />
<b>Standard Customization Path</b><br />
You can customize these tool tips simply by editing Description via the Settings > Customization UI> Form editor or field editor.</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-5057505024643182092013-10-11T05:15:00.000-07:002013-10-11T05:15:30.513-07:00MSCRM 2013 New Phone Number Format<div dir="ltr" style="text-align: left;" trbidi="on">
In the December 2012 Service Update, Phone Format was added for a number of telephone number fields on OOB entities. Most phone number fields in the OOB entities were also migrated as part of the release, but some fields, such as Fax number, did not get the Phone format.<br />
<br />
In CRM 2013, this format with the label Phone Number is being added to the list of available formats in the attribute editor.<br />
Fields with this format type enable a click-to-call experience for your telephony provider such as Lync or Skype.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifGPjuzz5rFYJj6oxVH2y9s6ynkE3ebN_iJV7W_ZkYYuSmIVooCDUPMw67KNVOxyfJ3vmvWGZ53DeZImaxTlWOmk4jyHoZ1qQPWExCtgOAyjuoOX5H3C5dbUYlA10xZYUAMzeZwxV1_xO7/s1600/Phonenumeber+format.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifGPjuzz5rFYJj6oxVH2y9s6ynkE3ebN_iJV7W_ZkYYuSmIVooCDUPMw67KNVOxyfJ3vmvWGZ53DeZImaxTlWOmk4jyHoZ1qQPWExCtgOAyjuoOX5H3C5dbUYlA10xZYUAMzeZwxV1_xO7/s400/Phonenumeber+format.JPG" width="400" /></a></div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-86875491250675242512013-10-10T07:46:00.003-07:002013-10-10T07:46:59.573-07:00Parsing Whole Number value while Setting in MSCRM 2011<div dir="ltr" style="text-align: left;" trbidi="on">
Int i;<br />
if (Int32.TryParse(TextBox_Employees.Text, out i))<br />
{<br />
mylead["numberofemployees"] = i;<br />
}</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-32530990326570133002013-10-10T07:45:00.000-07:002013-10-10T07:45:44.620-07:00Get selected Option Set value label in mscrm 2011 C#<div dir="ltr" style="text-align: left;" trbidi="on">
RetrieveAttributeRequest request = new RetrieveAttributeRequest();<br />
request.EntityLogicalName = targetEntity.LogicalName;<br />
request.LogicalName = optionsetLogicalName;<br />
request.RetrieveAsIfPublished = true; <br />
<br />
RetrieveAttributeResponse response = (RetrieveAttributeResponse)service.Execute(request);<br />
PicklistAttributeMetadata picklist = (PicklistAttributeMetadata)response.AttributeMetadata;<br />
<br />
var query = from option in picklist.OptionSet.Options<br />
where option.Value == int.Parse(Statusvalue.ToString())<br />
select option.Label.UserLocalizedLabel.Label;<br />
SselectedOptionSetlLabel = query.FirstOrDefault().ToString();</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-35903356589492154012013-10-07T03:15:00.002-07:002013-10-07T03:24:58.328-07:00Limitations for Business Rules in MSCRM 2013<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<b>Limitations for
Business Rules<o:p></o:p></b></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->Business rules in this release are intended to
address common actions. Compared to what a developer can do using form scripts,
business rules have limitations. However, business rules are not intended to
replace form scripts.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->The primary limitation you may find compared to
form scripts is that all conditions in the Business rules are evaluated using
AND. All the conditions must be true before the actions will be applied. There
is no support for OR or Else operators to provide for more complex logic. To
apply OR in your conditions you need to create separate rules for each
condition you want to test. This can be done efficiently by using the Save As
option and creating separate rules for each condition you want to test.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->Business rules run only when the form loads and
when field values change. They do not run when a record is saved.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->Business rules work only with fields. Form
scripts can interact with other visible elements such as tabs and sections
within the form</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->When you set a field value using a business
rule, any OnChange event handlers for that field will not run. This is to
reduce the potential for a circular reference which could lead to an infinite
loop.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->If a Business Rule references a field that is
not present on a form, the rule will simply not run. There will be no error
message.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->Calling other javascript web resources in the
system via the business rule editor is not possible.</div>
<br />
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->There is no ability to connect to external data
sources.</div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-71938557480060896582013-10-07T03:14:00.000-07:002013-10-07T03:24:58.332-07:00Business Rules in MSCRM 2013 (Notes)<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<b><span style="font-size: 18.0pt; line-height: 115%; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-hansi-font-family: Calibri;">Miscellaneous Topics </span></b><span style="font-size: 18.0pt; line-height: 115%; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 8.8pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Business rules
cannot be run across different entities. They have to be defined within the
same entity. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 8.8pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">By default, the
business rules are always created in a deactivated/draft state and must be
activated to start executing for the form. <o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">If there are
multiple business rules for a control, the rules will run in the order they
were added to the system. The last modified business rule runs last.<o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">If you try to
delete an attribute that has an active associated business rules, an error is
triggered:<o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 11.0pt;"> "Process Error"</span></div>
<div class="Default" style="margin-left: .5in;">
<span style="font-size: 11.0pt; mso-no-proof: yes;"><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600"
o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="Picture_x0020_1" o:spid="_x0000_i1025" type="#_x0000_t75"
style='width:449.25pt;height:249pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///C:\DOCUME~1\harim\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.emz"
o:title=""/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></span><span style="font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 8.9pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Business Rules
can run on the web client (all browsers), Outlook (online and offline), iPad
and CRM for tablets. However, they can only be customized through the Web
Client or Outlook (Online/connected mode). <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 8.9pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">A new privilege
for “Activate Business rules” under the customization tab for security roles
has been added. Without activating the business rule first, it will not be
executed. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 8.9pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Business Rules
are imported/exported with the entities that they are attached to. It is not
possible to export or import just a collection of business rules. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 8.9pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">If there are
multiple solutions, business rules will be run in the order in which the
solutions were imported and the latest installed solution’s rules will run
last. <o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">If you package a
managed/unmanaged solution, the states of the Business rules will be
transported as is into the target system: <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 2.3pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-size: 11.0pt; mso-fareast-font-family: Cambria;">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">activated rules
will be activated <o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-size: 11.0pt; mso-fareast-font-family: Cambria;">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">deactivated rules
will be deactivated <o:p></o:p></span></div>
<br />
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">There are no
limits on number of actions that can be attached to the business rule. <o:p></o:p></span></div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-72484585999164062013-10-07T03:02:00.003-07:002013-10-07T03:24:58.333-07:00Bussiness Rule Configuration Actions in MSCRM 2013<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Cambria, serif;"><b>Validate
data and show error message rules </b></span><span style="font-family: Cambria, serif;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Cambria, serif;"><b><br /></b></span></div>
<div class="MsoNormal" style="margin-bottom: 8.9pt;">
<span style="font-family: Cambria, serif;">Data in fields (as values) can be
validated and comparison can be made between different fields. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Cambria, serif;"> If the action states throwing an error
message, you can define the control that should display the message. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="Default">
<br /></div>
<div class="Default">
<b><span style="font-size: 11.0pt;">Show or Hide a field rules </span></b><span style="font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="Default">
<b><span style="font-size: 11.0pt;"><br /></span></b></div>
<div class="Default" style="margin-bottom: 8.9pt;">
<span style="font-size: 11.0pt;"> You can change whether the field is displayed
in the form. The options <b>are Show Field </b>and <b>Hide Field</b>. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 8.9pt;">
<span style="font-size: 11.0pt;"> These are applicable to only fields and not
for tabs, sections or controls like web resources and iframes. <o:p></o:p></span></div>
<div class="Default">
<span style="font-size: 11.0pt;">If you do not specify any
conditions, this is similar to setting state by default. <o:p></o:p></span></div>
<div class="Default">
<br /></div>
<div class="Default">
<b><span style="font-size: 11.0pt;">Enable or disable field
rules </span></b><span style="font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="Default">
<b><span style="font-size: 11.0pt;"><br /></span></b></div>
<div class="Default" style="margin-bottom: 8.9pt;">
<span style="font-size: 11.0pt;">The
options are <b>Lock </b>and <b>Unlock</b>. When the field is locked, you will
not be able to edit the value in the field. <o:p></o:p></span></div>
<div class="Default">
<span style="font-size: 11.0pt;"> If you do not specify any conditions, this is
similar to locking/unlocking the field by default. <o:p></o:p></span></div>
<div class="Default">
<br /></div>
<div class="Default">
<b><span style="font-size: 11.0pt;">Set field value rules </span></b><span style="font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="Default">
<b><span style="font-size: 11.0pt;"><br /></span></b></div>
<div class="Default">
<span style="font-size: 11.0pt;">Choose the <b>Field </b>and <b>Type</b>.
There are three types: <o:p></o:p></span></div>
<div class="Default">
<br /></div>
<div class="Default">
<span style="font-family: "Courier New"; font-size: 11.0pt;"> </span><b><i><span style="font-size: 11.0pt;">Field
</span></i></b><span style="font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="Default">
<br /></div>
<div class="Default">
<span style="font-size: 11.0pt;">Use this type to set the value
of one form field with the value of another field. <o:p></o:p></span></div>
<div class="Default">
<span style="font-family: "Courier New"; font-size: 11.0pt;"> </span><b><i><span style="font-size: 11.0pt;">Value
</span></i></b><span style="font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="Default">
<br /></div>
<div class="Default">
<span style="font-size: 11.0pt;">Use this type to set the value
of a form field with a value you enter. <o:p></o:p></span></div>
<div class="Default">
<span style="font-family: "Courier New"; font-size: 11.0pt;"> </span><b><i><span style="font-size: 11.0pt;">Formula
</span></i></b><span style="font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="Default">
<br /></div>
<div class="Default">
<span style="font-size: 11.0pt;">This option only appears for
numerical or date data types. It does not appear for fields that contain text.
Use this type to set the value to the result of a simple calculation that may
use either a value in another form field or a value you enter. <o:p></o:p></span></div>
<div class="Default">
<span style="font-size: 11.0pt;"> If you do not specify any condition, this is
similar to setting a default value for the field. <o:p></o:p></span></div>
<div class="Default">
<br /></div>
<div class="Default">
<b><span style="font-size: 11.0pt;">Set field requirement rules </span></b><span style="font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="Default">
<b><span style="font-size: 11.0pt;"><br /></span></b></div>
<div class="Default" style="margin-bottom: 8.8pt;">
<span style="font-size: 11.0pt;"> The options are <b>Not Business Required </b>and
<b>Business Required</b>. There is no option to set this to business
recommended. <o:p></o:p></span></div>
<div class="Default">
<span style="font-size: 11.0pt;">If you do not specify any
condition, this is similar to setting the default business requirement state. <o:p></o:p></span></div>
<br />
<div class="Default">
<br /></div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-46878135352482552242013-10-04T03:08:00.003-07:002013-10-07T03:24:58.330-07:00Quick Forms in MSCRM 2013<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<b><span style="font-size: 20.0pt; line-height: 115%;">Quick
Forms:<o:p></o:p></span></b></div>
<div class="MsoNormal">
<b><span style="font-size: 20.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal">
A quick form is a special type of CRM form that gives you
the ability to display data from related entities onto the main form of any
entity.</div>
<div class="Default">
<br /></div>
<div class="Default">
<span style="font-size: 11.0pt;">Quick forms will also be known
as “Quick View Forms” since this form can be placed inside other main forms.
They are rendered as read only so that quick form’s fields are not editable
when placed on another form <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="Default">
Features:</div>
<div class="Default">
<br /></div>
<div class="Default" style="margin-bottom: 10.0pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">These forms can
be exported/imported as part of solutions. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 10.0pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">These forms can
be created/updated or deleted through the SDK. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 10.0pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Quick forms can
be created/modified using the main form editor. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 10.0pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Only sections,
spacers, fields and subgrids can be added. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 10.0pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">A single column
tab is used for quick forms and this cannot be changed. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 10.0pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">No iframe or
webresources are allowed. <o:p></o:p></span></div>
<div class="Default" style="margin-bottom: 10.0pt; margin-left: .5in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">Notes controls
are not allowed. <o:p></o:p></span></div>
<div class="Default" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 11.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><span style="font-size: 11.0pt;">There is no
header or footer in quick forms. <o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<br /></div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-9206960935025375392013-09-26T00:57:00.002-07:002013-09-26T00:57:58.361-07:00Set Default View in Party Lookup (Regarding)Type in MS CRM 2011<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 class="post-title" style="background-color: white; clear: both; color: #333333; font-family: Tahoma, Arial, Helvetica, sans-serif; font-weight: normal; line-height: 1.5em;">
<span style="font-size: 13px; line-height: 1.6em;">Set Default View in Party Lookup (Regarding)Type in MS CRM 2011</span></h1>
<div class="entry-content" style="background-color: white; border: 0px; color: #333333; font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.6em; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<div style="line-height: 1.6em; margin-bottom: 1em; margin-top: 1em;">
Use the following code to set the Regarding Lookup to Incident instead of Account and set the default view.</div>
<div style="line-height: 1.6em; margin-bottom: 1em; margin-top: 1em;">
<strong>document.getElementById(“regardingobjectid”).setAttribute(“defaulttype”, “112″);</strong><br /><strong>Xrm.Page.getControl(“regardingobjectid”).setDefaultView(“Guid of the View to be displayed”);</strong></div>
<div style="line-height: 1.6em; margin-bottom: 1em; margin-top: 1em;">
<br /></div>
</div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-63818451878183800932013-09-23T07:44:00.000-07:002013-09-23T07:44:48.511-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 class="post-title entry-title" style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 22px; font-weight: normal; margin: 0.75em 0px 0px; position: relative;">
<a href="http://mscrmshop.blogspot.in/2011/09/how-to-create-email-activity-using-rest.html" style="color: #cc6511; text-decoration: none;">How to create an email activity using REST Endpoints in CRM2011</a></h3>
<div class="post-header" style="background-color: white; color: #222222; font-family: 'Trebuchet MS', Trebuchet, sans-serif; font-size: 11px; line-height: 1.6; margin: 0px 0px 1.5em;">
<div class="post-header-line-1">
</div>
</div>
<div class="post-body entry-content" id="post-body-3773223733503537607" style="background-color: white; color: #222222; font-family: 'Trebuchet MS', Trebuchet, sans-serif; font-size: 13px; line-height: 1.4; position: relative; width: 830px;">
<br />
How tough it can be to create an activity using code? It sounds very easy but there are few issues, if you are using REST Endpoints.<br />
<br />
REST Endpoints do not support all the CRM data types. One of those data type is PartyList. PartyList is very important to create most of the activity like emails, appointments, phone calls etc.<br />
<br />
To set the value of the PartyList field you need an array of PartyLists as you can have more than value for those fields. For e.g you can have more than one recipient for an email or you can have more than resource for an appointment.<br />
<br />
As I mentioned earlier, REST Endpoints do not support PartyList, So its is impossible to assign value to these fields. If you look at DataSet returned by the Rest Endpoints, It looks like they are treating PartyList fields like string fields.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtfU0igp_Rr5HaLgzF8LPLcZaAkLGVIv_E8_4M5A3jYS3R1eW_D9iYozy3rYg3keOzKCHfg_DgcSd9f6BxTV6UfZUHsK47uc7f_XSEcUZfMnmh4gflF-a7opIVXxcujXyoRV7tfMct5Xc/s1600-h/image%25255B4%25255D.png" style="color: #cc6511; text-decoration: none;"><img alt="image" border="0" height="55" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlOdzctnYEI6HQ1gU6xccyyPvPNvccaEsGe6fDEYhBebfyLFaidCUGwcMT9aiQUs8TBbSFPcM1ARm4niA2zj85AqTyLfLioNjFV1NXYj3x5yP3Sa2uwEHSLD-k1emIeZJEl2ZHFvK0aQU/?imgmax=800" style="-webkit-box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; background-image: none; border: 0px; box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; display: inline; padding: 0px 0px 5px; position: relative;" title="image" width="615" /></a><br />
<br />
These values does not even return the guid or name of the PartyList entity. if you look at sender field in the screen shot above, it does not have guid or the name of the system user who sent this email.<br />
I tried the same using following code:<br />
<br />
<pre class="prettyprint prettyprinted" style="border: 1px solid rgb(136, 136, 136); padding: 2px;"><span class="pln" style="color: black;">email</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">Sender</span><span class="pun" style="color: #666600;">=</span><span class="str" style="color: #008800;">"crm2011@emailops.com.au"</span><span class="pun" style="color: #666600;">;</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">var</span><span class="pln" style="color: black;"> partlistcollection </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">new</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Array</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;"> </span><span class="com" style="color: #880000;">//tried to create an array of PartyLists</span><span class="pln" style="color: black;">
partlistcollection</span><span class="pun" style="color: #666600;">[</span><span class="lit" style="color: #006666;">0</span><span class="pun" style="color: #666600;">]</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="typ" style="color: #660066;">Id</span><span class="pun" style="color: #666600;">:</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"8384E684-7686-E011-8AF0-00155D32042E"</span><span class="pun" style="color: #666600;">,</span><span class="typ" style="color: #660066;">LogicalName</span><span class="pun" style="color: #666600;">:</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"contact"</span><span class="pun" style="color: #666600;">,</span><span class="typ" style="color: #660066;">Name</span><span class="pun" style="color: #666600;">:</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"Amreek Singh"</span><span class="pun" style="color: #666600;">};</span><span class="pln" style="color: black;">
email</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">ToRecipients</span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;">JSON</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">stringify</span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">partlistcollection</span><span class="pun" style="color: #666600;">);</span></pre>
<pre class="brush: csharp"></pre>
But it did not work, if you pass a string value to the PartyList fields, You won’t get any error message but you won’t see any value in those fields on a created entity.<br />
<br />
Now here is the solution. You need to create an activity (in this case it’s an email) first and then create a PartyList entity and link it back to the created activity.<br />
<br />
<pre class="prettyprint prettyprinted" style="border: 1px solid rgb(136, 136, 136); padding: 2px;"><span class="kwd" style="color: #000088;">function</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">CreateEmail</span><span class="pun" style="color: #666600;">()</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
alert</span><span class="pun" style="color: #666600;">(</span><span class="str" style="color: #008800;">"CreateEmail Begin"</span><span class="pun" style="color: #666600;">);</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">var</span><span class="pln" style="color: black;"> email </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">new</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Object</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
email</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">Subject</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"Sample Email Using REST"</span><span class="pun" style="color: #666600;">;</span><span class="pln" style="color: black;">
SDK</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">JScriptRESTDataOperations</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">Create</span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">email</span><span class="pun" style="color: #666600;">,</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"Email"</span><span class="pun" style="color: #666600;">,</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">EmailCallBack</span><span class="pun" style="color: #666600;">,</span><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">function</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">error</span><span class="pun" style="color: #666600;">)</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;"> alert</span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">error</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">message</span><span class="pun" style="color: #666600;">);</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">});</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">// Email Call Back function</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">function</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">EmailCallBack</span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">result</span><span class="pun" style="color: #666600;">)</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">var</span><span class="pln" style="color: black;"> activityParty</span><span class="pun" style="color: #666600;">=</span><span class="kwd" style="color: #000088;">new</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Object</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">// Set the "party" of the ActivityParty // EntityReference of an entity this activityparty relatated to. </span><span class="pln" style="color: black;">
activityParty</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">PartyId</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="typ" style="color: #660066;">Id</span><span class="pun" style="color: #666600;">:</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"8384E684-7686-E011-8AF0-00155D32042E"</span><span class="pun" style="color: #666600;">,</span><span class="com" style="color: #880000;">//replace this with the contactid from your system.</span><span class="pln" style="color: black;">
</span><span class="typ" style="color: #660066;">LogicalName</span><span class="pun" style="color: #666600;">:</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"contact"</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">};</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">// Set the "activity" of the ActivityParty</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">// EntityReference.</span><span class="pln" style="color: black;">
activityParty</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">ActivityId</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="typ" style="color: #660066;">Id</span><span class="pun" style="color: #666600;">:</span><span class="pln" style="color: black;"> result</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">ActivityId</span><span class="pun" style="color: #666600;">,</span><span class="pln" style="color: black;">
</span><span class="typ" style="color: #660066;">LogicalName</span><span class="pun" style="color: #666600;">:</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"email"</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">};</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">// Set the participation type (what role the party has on the activity).</span><span class="pln" style="color: black;">
activityParty</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">ParticipationTypeMask</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Value</span><span class="pun" style="color: #666600;">:</span><span class="pln" style="color: black;"> </span><span class="lit" style="color: #006666;">2</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">};</span><span class="pln" style="color: black;"> </span><span class="com" style="color: #880000;">// 2 mean ToRecipients</span><span class="pln" style="color: black;">
SDK</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">JScriptRESTDataOperations</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">Create</span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">activityParty</span><span class="pun" style="color: #666600;">,</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"ActivityParty"</span><span class="pun" style="color: #666600;">,</span><span class="typ" style="color: #660066;">ActivityPartyCallBack</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">,</span><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">function</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">error</span><span class="pun" style="color: #666600;">)</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;"> alert</span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">error</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">message</span><span class="pun" style="color: #666600;">);</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">});</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">function</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">ActivityPartyCallBack</span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">reuslt</span><span class="pun" style="color: #666600;">)</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
alert</span><span class="pun" style="color: #666600;">(</span><span class="str" style="color: #008800;">"Process Completed"</span><span class="pun" style="color: #666600;">);</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span></pre>
activityParty.ParticipationTypeMask = { Value: 2 }; is very important as it will specify if this PartList is sender/recipient/resource etc of the activity.<br />
<br />
Here is the link to complete list of activityParty.ParticipationTypeMask <a href="http://msdn.microsoft.com/en-us/library/cc151230.aspx" style="color: #cc6511; text-decoration: none;">click here.</a><br />
For this sample, I have used the generic REST CRUD data operations library created by Jim Daly.<br />
Add references to following Java Script web resources to try the solution.<br />
<ul style="line-height: 1.4; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="margin: 0px 0px 0.25em; padding: 0px;">SDK.JScriptRESTDataOperations</li>
<li style="margin: 0px 0px 0.25em; padding: 0px;">JSON2</li>
</ul>
Here is the link to unmanaged solution <a href="https://skydrive.live.com/redir.aspx?cid=3b7a5e0d9e37a0c8&resid=3B7A5E0D9E37A0C8!124" style="color: #cc6511; text-decoration: none;">RESTEmailSolution_1_0</a><br />
<ul style="line-height: 1.4; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="margin: 0px 0px 0.25em; padding: 0px;">I hope this helps.</li>
</ul>
<div style="clear: both;">
</div>
</div>
<div class="post-footer" style="background-color: #f9f9f9; border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; color: #666666; font-family: 'Trebuchet MS', Trebuchet, sans-serif; font-size: 11px; line-height: 1.6; margin: 20px -2px 0px; padding: 5px 10px;">
<div class="post-footer-line post-footer-line-1">
<span class="post-author vcard" style="margin-left: 0px; margin-right: 1em;">Posted by <span class="fn">Amreek Singh</span> </span><span class="post-timestamp" style="margin-left: -1em; margin-right: 1em;">a</span></div>
</div>
</div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0tag:blogger.com,1999:blog-4549045511944997525.post-6478188276944739982013-09-23T06:41:00.000-07:002013-09-23T06:41:29.081-07:00Call A Dialog from Ribbon in MSCRM 2011<div dir="ltr" style="text-align: left;" trbidi="on">
<pre class="prettyprint prettyprinted" style="background-color: white; border: 1px solid rgb(136, 136, 136); color: #222222; font-size: 13px; line-height: 18px; padding: 2px;"><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">function</span><span class="pln" style="color: black;"> getOrg</span><span class="pun" style="color: #666600;">()</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">///<summary></span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">/// get organisation</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">///</summary></span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">var</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Org</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">""</span><span class="pun" style="color: #666600;">;</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">if</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">(</span><span class="kwd" style="color: #000088;">typeof</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">GetGlobalContext</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">==</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"function"</span><span class="pun" style="color: #666600;">)</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">var</span><span class="pln" style="color: black;"> context </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">GetGlobalContext</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
</span><span class="typ" style="color: #660066;">Org</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> context</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">getOrgUniqueName</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">else</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">if</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">(</span><span class="kwd" style="color: #000088;">typeof</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Xrm</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">Page</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">context </span><span class="pun" style="color: #666600;">==</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"object"</span><span class="pun" style="color: #666600;">)</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="typ" style="color: #660066;">Org</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Xrm</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">Page</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">context</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">getOrgUniqueName</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">else</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">throw</span><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">new</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Error</span><span class="pun" style="color: #666600;">(</span><span class="str" style="color: #008800;">"Unable to access Organisation name"</span><span class="pun" style="color: #666600;">);</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">return</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Org</span><span class="pun" style="color: #666600;">;</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">function</span><span class="pln" style="color: black;"> getUser</span><span class="pun" style="color: #666600;">()</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">///<summary></span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">/// get logged in user</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">///</summary></span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">var</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">User</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">""</span><span class="pun" style="color: #666600;">;</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">if</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">(</span><span class="kwd" style="color: #000088;">typeof</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">GetGlobalContext</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">==</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"function"</span><span class="pun" style="color: #666600;">)</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">var</span><span class="pln" style="color: black;"> context </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">GetGlobalContext</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
</span><span class="typ" style="color: #660066;">User</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> context</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">getUserId</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">else</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">if</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">(</span><span class="kwd" style="color: #000088;">typeof</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Xrm</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">Page</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">context </span><span class="pun" style="color: #666600;">==</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"object"</span><span class="pun" style="color: #666600;">)</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="typ" style="color: #660066;">User</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">=</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Xrm</span><span class="pun" style="color: #666600;">.</span><span class="typ" style="color: #660066;">Page</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">context</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">getUserId</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">else</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">throw</span><span class="pln" style="color: black;"> </span><span class="kwd" style="color: #000088;">new</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">Error</span><span class="pun" style="color: #666600;">(</span><span class="str" style="color: #008800;">"Unable to access the UserId"</span><span class="pun" style="color: #666600;">);</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">return</span><span class="pln" style="color: black;"> </span><span class="typ" style="color: #660066;">User</span><span class="pun" style="color: #666600;">;</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">function</span><span class="pln" style="color: black;"> callDialog</span><span class="pun" style="color: #666600;">()</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
</span><span class="kwd" style="color: #000088;">var</span><span class="pln" style="color: black;"> url</span><span class="pun" style="color: #666600;">=</span><span class="str" style="color: #008800;">"/"</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">+</span><span class="pln" style="color: black;"> getOrg</span><span class="pun" style="color: #666600;">()</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">+</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"/cs/dialog/rundialog.aspx?DialogId=%7bB7D825D7-7EF6-4713-AC11-284546FEB260%7d&EntityName=systemuser&ObjectId="</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">+</span><span class="pln" style="color: black;"> getUser</span><span class="pun" style="color: #666600;">();</span><span class="pln" style="color: black;">
window</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">open</span><span class="pun" style="color: #666600;">(</span><span class="pln" style="color: black;">url</span><span class="pun" style="color: #666600;">,</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">""</span><span class="pun" style="color: #666600;">,</span><span class="pln" style="color: black;"> </span><span class="str" style="color: #008800;">"status=no,scrollbars=no,toolbars=no,menubar=no,location=no"</span><span class="pun" style="color: #666600;">);</span><span class="pln" style="color: black;">
</span><span class="com" style="color: #880000;">//window.open(url);</span><span class="pln" style="color: black;">
</span><span class="pun" style="color: #666600;">}</span></pre>
<pre style="background-color: white; color: #222222; font-size: 13px; line-height: 18px;"><span class="Apple-style-span" style="font-family: Georgia, serif; font-size: 16px; white-space: normal;"><b>The JavaScript Webresource has three function</b></span></pre>
<ul style="background-color: white; color: #222222; font-family: 'Trebuchet MS', Trebuchet, sans-serif; font-size: 13px; line-height: 18px; margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="margin: 0px 0px 0.25em; padding: 0px;">getOrganisation() – to get context organisation</li>
<li style="margin: 0px 0px 0.25em; padding: 0px;">getUser()-to get the logged in user</li>
<li style="margin: 0px 0px 0.25em; padding: 0px;">callDialog()- will call the dialog. you can change the DialogId to call your own dialog.</li>
</ul>
<span style="background-color: white; color: #222222; font-family: 'Trebuchet MS', Trebuchet, sans-serif; font-size: 13px; line-height: 18px;">This example is using a dialog attached to the user entity, so we don’t need to create any record to run the dialog. The code picks up the logged in user and run the process.</span></div>
hari mallampatihttp://www.blogger.com/profile/10704787062077425625noreply@blogger.com0