tag:blogger.com,1999:blog-71709907970451355672024-03-27T04:28:35.979-07:00The Microsoft Dynamics Crm ClubA Step-By-Step Walk-Through CRM 2011 designed for Begginer and Professional CRM DevelopersCarmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.comBlogger62125tag:blogger.com,1999:blog-7170990797045135567.post-89544196236411550122020-12-30T21:31:00.000-08:002020-12-30T21:31:49.666-08:00How to find and debug your custom Javascript files in Dynamics CRM / 365In this article we describe <b>Step by step How to find and debug your custom Javascript files in Dynamics CRM / 365 in 5 minutes.</b><br />
After you have coded you javascript files, you want to find them for debugging purposes. It could be a not easy task to find them between the hundreds of source files that Dynamics 365 will load to the browser:<div><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5la_7PgqvsWpTg5MU_dp3Kz97UD3fhwvCTxD48DWQbxdK9UPB5f2bDkA6jPcIGRwmbm_FpJkjX1eGbFaGeuJ3aigEEsoKr0yodHFMiQPbDgvsCGzTAsNpUAH8NKJxOKvekcDijn4rIz0/s1600/0.PNG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="501" data-original-width="402" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5la_7PgqvsWpTg5MU_dp3Kz97UD3fhwvCTxD48DWQbxdK9UPB5f2bDkA6jPcIGRwmbm_FpJkjX1eGbFaGeuJ3aigEEsoKr0yodHFMiQPbDgvsCGzTAsNpUAH8NKJxOKvekcDijn4rIz0/s320/0.PNG" width="256" /></a></div>
<b><br /></b><b><br /></b><br />
<h3 style="text-align: center;">
How to find and debug your custom Javascript files in Dynamics CRM / 365</h3>
To debug quickly your javascript files, just follow this steps:<br />
<br />
1) Open the FORM of the Entity your are working on, and go to the Properties of the Form. Open the Web Resources and find the JAVASCRIPT LIBRARY that you want to debug. Double-click it to open the editor:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwSD5k6u-fYC-AbwtzLVJ4UwTLRrgTi8P8vuRw1Ik6BcJi69TsPn7cfq8Zl5rOUVwn3txylbJwlcO9LP2fwg7Q8ux9HH7P9dXIHxQK9BXd-2NQlXKtFyRuoi2BgAQSuZVvO92Qv6EUt0s/s1600/1.PNG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="139" data-original-width="413" height="107" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwSD5k6u-fYC-AbwtzLVJ4UwTLRrgTi8P8vuRw1Ik6BcJi69TsPn7cfq8Zl5rOUVwn3txylbJwlcO9LP2fwg7Q8ux9HH7P9dXIHxQK9BXd-2NQlXKtFyRuoi2BgAQSuZVvO92Qv6EUt0s/s320/1.PNG" width="320" /></a></div>
<br />
<br />
<br />
2) Once opened the Editor, type into your javascript file , the "debugger; " command:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaWlI4HcGw8_2MAcRAYxgn3mX3DqTHykU0Bk5L88DG3MbhGM9ZOHETNz6DpuIDB4Xz7PPLxgTzWbOwp-GKwwdC-ak5E0qmUvjE3zLhMt-jJpefgGXJ4DXd0KPzXDIvTDg7adONhyphenhyphen3t8iA/s1600/2.PNG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="301" data-original-width="566" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaWlI4HcGw8_2MAcRAYxgn3mX3DqTHykU0Bk5L88DG3MbhGM9ZOHETNz6DpuIDB4Xz7PPLxgTzWbOwp-GKwwdC-ak5E0qmUvjE3zLhMt-jJpefgGXJ4DXd0KPzXDIvTDg7adONhyphenhyphen3t8iA/s640/2.PNG" width="640" /></a></div>
<br />
<br />
3) Save it, save the Form, Publish it and open the Developer's Tools of the browser:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2uL1p9u3foL6n1yGawI317xQRPMDC9SYf84ZDzFAoo8fIiUQsWcvJianzQtitdD4XCee_4RMXYRxMiAR-BeVKnqPx_kRtjdUsGm3olYL6uq8O3LjXK_ZNkcEpLVPM3oEDGuHQDchKauk/s1600/3.PNG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="606" data-original-width="721" height="335" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2uL1p9u3foL6n1yGawI317xQRPMDC9SYf84ZDzFAoo8fIiUQsWcvJianzQtitdD4XCee_4RMXYRxMiAR-BeVKnqPx_kRtjdUsGm3olYL6uq8O3LjXK_ZNkcEpLVPM3oEDGuHQDchKauk/s400/3.PNG" width="400" /></a></div>
<br />
<br />
4) Then , just perform the Click or anything else that would trigger your javascript code: from here, you can add breakpoints to stop the script execution.<br />
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen Step by step How to find and debug your custom Javascript files in Dynamics CRM / 365 in 5 minutes.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span face=""open sans" , sans-serif" style="color: #333333; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
</div>
</div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b></div>Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-38278639801119599142020-03-21T22:30:00.000-07:002020-03-21T22:30:24.216-07:00SOLVED ERROR "There is a problem communicating with the Microsoft CRM Server" when configuring Microsoft Dynamics CRM for OutlookIn this article we describe <b>Step by step </b><b>How to solve the ERROR "There is a problem communicating with the Microsoft CRM Server" when configuring Microsoft Dynamics CRM for Outlook.</b><br />
This error can occur during/after the installation the Microsoft Dynamics CRM client addon for Microsoft Office Outlook.After getting this message, you might this other one, while clicking the OK button:<br />
"An error occurred loading Microsoft CRM functionality. Try restarting Microsoft Outlook. Contact your system administrator if error persists."<br />
<b><br /></b><b><br /></b><br />
<h3 style="text-align: center;">
<b style="font-size: medium; text-align: start;"> </b><b style="font-size: medium; text-align: start;">How to solve the ERROR "There is a problem communicating with the Microsoft CRM Server" when configuring Microsoft Dynamics CRM for Outlook</b></h3>
<br />
<br />
To resolve this problem, follow this steps:<br />
<br />
1) Open the IE Options,and click the Security tab. Click Local intranet >> Sites, and then Advanced.<br />
Then type the IP of the Microsoft CRM server, and click OK three times. Restart Microsoft Outlook.<br />
<div>
<br /></div>
<div>
<br />
2) Open regedit, and locate the following subkey: HKEY_CURRENT_USER\ Software\Microsoft\MSCRMClient. There, check for the correct URL of your Microsoft CRM server.<br />
<br />
If these steps were NOT enought , continue with the following:</div>
<div>
<br /></div>
<div>
3) Inside Dynamics CRM, open Settings >> Business Unit Settings >> Users, and locate the user who is experiencing this error. Click the information side tab, and there clear the Restricted Access Mode check box.</div>
<div>
<br /></div>
<div>
4) Open CONTROL from the Start of your PC, and open User Accounts >>> Advanced tab.<br />
Click Manage Passwords, and proceed to delete all CRM passwords and usernames there.<br />
<br />
<br />
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen Step by step <b> </b><b>How to solve the ERROR "There is a problem communicating with the Microsoft CRM Server" when configuring Microsoft Dynamics CRM for Outlook</b>.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
</div>
</div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><br />
<b><br /></b>
<b><br /></b></div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com1tag:blogger.com,1999:blog-7170990797045135567.post-44299863889484311382019-12-20T06:11:00.001-08:002020-01-14T21:53:18.965-08:00Deep Insert Request for Account Entity using AJAX on Dynamics 365<br />
The following request body posted to the Account entity set will create a total of four new entities in the context of creating an account.<br />· A contact is created because it is defined as an object property of the single-valued navigation property primarycontactid.<br />· An opportunity is created because it is defined as an object within an array that is set to the value of a collection-valued navigation property opportunity_customer_accounts.<br />· A task is created because it is defined an object within an array that is set to the value of a collection-valued navigation property Opportunity_Tasks.The following is the source I used for this:<br />
<br />
<a href="https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/create-entity-web-api#bkmk_CreateRelated" target="_blank">https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/create-entity-web-api#bkmk_CreateRelated</a><br />
<br />
<br />
var fnDeepInsert = () => {<br />
<br />
let entityName = "accounts";<br />
let clientURL = parent.Xrm.Page.context.getClientUrl();<br />
let req = new XMLHttpRequest();<br />
<br />
req.open("POST", encodeURI(clientURL + "/api/data/v9.1/" + entityName, true));<br />
req.setRequestHeader("Accept", "application/json");<br />
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");<br />
req.setRequestHeader("OData-MaxVersion", "4.0");<br />
req.setRequestHeader("OData-Version", "4.0");<br />
<br />
req.onreadystatechange = function () {<br />
if (this.readyState == 4 ) {<br />
req.onreadystatechange = null;<br />
if (this.status == 204) {<br />
alert("No Content = Four Entities created using DEEP INSERT");<br />
}<br />
else {<br />
let error = JSON.parse(this.response).error;<br />
alert(error.message);<br />
}<br />
}<br />
};<br />
<br />
req.send(JSON.stringify(<br />
{<br />
name: "Account",<br />
primarycontactid:<br />
{<br />
firstname: "Bender",<br />
lastname: "Rodriguez"<br />
},<br />
opportunity_customer_accounts:<br />
[<br />
{<br />
name: "Opportunity for Bender",<br />
Opportunity_Tasks:<br />
[<br />
{ subject: "Task related to Bender" }<br />
]<br />
}<br />
]<br />
}));<br />
}<br />
<div>
<br /></div>
<br />
<br />
<br />
<div style="background-color: #fff9ee; color: #222222; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; line-height: 13.5pt; margin: 0cm 0cm 0cm 36pt; text-indent: -18pt;">
<span style="font-family: "verdana" , sans-serif;"><span style="color: #2a2a2a; font-size: 10pt;"><br /></span></span></div>
<div style="background-color: #fff9ee; color: #222222; font-family: Georgia, Utopia, "Palatino Linotype", Palatino, serif; font-size: 15.4px; line-height: 13.5pt; margin: 0cm 0cm 0cm 36pt; text-indent: -18pt;">
<span style="font-family: "verdana" , sans-serif;"><span style="color: #2a2a2a; font-size: 10pt;"><br /></span></span></div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com2tag:blogger.com,1999:blog-7170990797045135567.post-42566008997335438002019-12-13T05:04:00.000-08:002019-12-13T05:04:06.143-08:00Dynamics 365 - How to retrieve METADATA for an Entity using a OData REST GET requestIn this article we describe <b>How to retrieve METADATA for an Entity using a OData REST GET request using Web API and Javascript .</b><br />
<b><br /></b><b><br /></b><br />
<h3 style="text-align: center;">
How to retrieve METADATA for an Entity using a OData REST GET request using Web API and Javascript </h3>
<b><br /></b><b>Send to the Dynamics webservice the following HTTP request :</b><b><br /></b><br />
<a href="http://svdcrm16/pniyot/api/data/v8.2/EntityDefinitions(LogicalName='phonecall')?$select=LogicalName&$expand=Attributes($select=LogicalName)"><b>http://DOMAIN/ORGANIZATION/api/data/v8.2/EntityDefinitions(LogicalName='phonecall')?$select=LogicalName&$expand=Attributes($select=LogicalName)</b></a><br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglR75tFufybRhJSSKXeGxRfTKXqwokeKqDyGSXMbOmlAkvonTyJjRm7SgUF2fqKsAovCxLXLgv73DgE4abUKx0pX9nTs_FkbTf_ylau1ipDCSzg1OOYQNnfdgG_y3WvC9-m5_mtNDS7gs/s1600/METADATA.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="758" data-original-width="879" height="548" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglR75tFufybRhJSSKXeGxRfTKXqwokeKqDyGSXMbOmlAkvonTyJjRm7SgUF2fqKsAovCxLXLgv73DgE4abUKx0pX9nTs_FkbTf_ylau1ipDCSzg1OOYQNnfdgG_y3WvC9-m5_mtNDS7gs/s640/METADATA.PNG" width="640" /></a></div>
<br />
<br />
<br />
<b><br /></b><b><br /></b><br />
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen How to retrieve METADATA for an Entity using a OData REST GET request using Web API and Javascript .<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-32680541833767669772019-12-06T03:20:00.000-08:002019-12-06T03:20:51.441-08:00How to create a Microsoft Word mail merge document with Dynamics 365 for OutlookIn this article we describe <b>Step by step How to create a Microsoft Word mail merge document with Dynamics 365 for Outlook in 10 minutes.</b><br />
<br />
<b>Dynamics 365 for Outlook </b> allows to easily create mail merge documents and also templates for reuse. This way, you can use an existing template to create email messages, letters , faxes, quotes, etc, to be sent to leads, opportunities, contacts, accounts, or marketing mailing lists.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipgXiqEf2AHGbGoocJwRNJ04xK9SQidX2v2hlB9eItxmz8k8iIvgFmyIg-hMdH-2kzte5NfFS2SPjgKEBalYEE6W1cCaR8qIVkoP8E255WJ8SHftx9jQAdUqWUlXIsKhpsxU5JirE9VoA/s1600/5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="900" data-original-width="1339" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipgXiqEf2AHGbGoocJwRNJ04xK9SQidX2v2hlB9eItxmz8k8iIvgFmyIg-hMdH-2kzte5NfFS2SPjgKEBalYEE6W1cCaR8qIVkoP8E255WJ8SHftx9jQAdUqWUlXIsKhpsxU5JirE9VoA/s640/5.PNG" width="640" /></a></div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><br />
<h3 style="text-align: center;">
How to create a Microsoft Word mail merge document with Dynamics 365 for Outlook</h3>
<div class="separator" style="clear: both; text-align: left;">
To perform the mail merge in <b>Dynamics 365 for Outlook</b> , follow this steps :</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
1) In the <b>Dynamics 365 for Outlook </b>tab, click on "Advanced Find", and look for the Contacts, Leads, Users, or whatever entity you want to use in the mail merge:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNjNPlmlfXiQErlBUbhW5TvaqRlip2pNevMrl2f4jV6MM6mfZHukMIhvntiBk2dlPxCJBVPB5TVKh8x1YQf0BrZfXJ_Q7cCyiS2lE4HPq1ZrMqmvERGa0DwU_TikKQ_bF7yVJw2TZy3kk/s1600/8.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="123" data-original-width="245" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNjNPlmlfXiQErlBUbhW5TvaqRlip2pNevMrl2f4jV6MM6mfZHukMIhvntiBk2dlPxCJBVPB5TVKh8x1YQf0BrZfXJ_Q7cCyiS2lE4HPq1ZrMqmvERGa0DwU_TikKQ_bF7yVJw2TZy3kk/s1600/8.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2) Select all the entities that you want to merge, and click on the "Mail Merge" button:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYfUAmnfhyX8vSx3DvXZ7qq1_YTYOoh2sGRNpL5-rrt7QV3Khi-LXiYAWD5nQvQemas4hydtmnUwfY2ObSAzqHyLKamz9M9pRq_6QBKOeQOZFjdOsKu_P7AZTmup53SpvgrXanI6uvNq4/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="132" data-original-width="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYfUAmnfhyX8vSx3DvXZ7qq1_YTYOoh2sGRNpL5-rrt7QV3Khi-LXiYAWD5nQvQemas4hydtmnUwfY2ObSAzqHyLKamz9M9pRq_6QBKOeQOZFjdOsKu_P7AZTmup53SpvgrXanI6uvNq4/s1600/1.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
3) A Mail Merge dialog box will open, where you can select the type of document you want to use. It can be an empty document or a pre-built template. Keep in mind that <b>Dynamics 365 for Outlook </b>gives you the option of saving the present mail merge document as a TEMPLATE, to be reused later.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5gjgXED1ZyiUVt8eS6RjVINeHHKnxpvyrvpulIhlNk32Hp2Eu2DlTX3rqgL87O7Hqyaknw5Ws9mLUN_N5wTh3mRZm44U1Rgv1iYhhpOFwZPKt8bZvf4xtoFO-JHVG6o5WeJxZykzfd54/s1600/7.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="501" data-original-width="584" height="274" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5gjgXED1ZyiUVt8eS6RjVINeHHKnxpvyrvpulIhlNk32Hp2Eu2DlTX3rqgL87O7Hqyaknw5Ws9mLUN_N5wTh3mRZm44U1Rgv1iYhhpOFwZPKt8bZvf4xtoFO-JHVG6o5WeJxZykzfd54/s320/7.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
4) Then you can add data fields, up to 62 CRM fields that you can use on the mail merge document. After you selected the fields, you click on the "DOWNLOAD" button, in order to load the template or the new document that you are creating. The editable document will open:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE8RlkzyWRqISTZCX3jpNnfkAw9hK0vqNZIb2HuiYxnkZwaWJhqrBqdll-W1fh7vV-KXb69-DW43vvzF1_morMR6Anj9_dUiogjwB6a5TCXSd5UuW5DcDGSH-S6TjLzw5BujHFc5EcE5Q/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1001" data-original-width="1402" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE8RlkzyWRqISTZCX3jpNnfkAw9hK0vqNZIb2HuiYxnkZwaWJhqrBqdll-W1fh7vV-KXb69-DW43vvzF1_morMR6Anj9_dUiogjwB6a5TCXSd5UuW5DcDGSH-S6TjLzw5BujHFc5EcE5Q/s400/2.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
5) Now it's time for you to edit the document according to your needs. You can click on the standard links "Address block" , "Greeting line", etc, and then you can use the fields that previously you added to the mail merge , by clicking on "More items":</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_ycWn8qGEjPtlwkEhOBVk621P40WUOMEXYFwCu6EjuE5SToYhOdRRDmwRG4tve0COAESoWNHxbKv8E_UeJVSFNWUMb9tTVi8ocz2sdwNJIEU9xYt7I1Bt4eoHG4aQS-ecu2pRfmMZRhg/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="888" data-original-width="1262" height="281" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_ycWn8qGEjPtlwkEhOBVk621P40WUOMEXYFwCu6EjuE5SToYhOdRRDmwRG4tve0COAESoWNHxbKv8E_UeJVSFNWUMb9tTVi8ocz2sdwNJIEU9xYt7I1Bt4eoHG4aQS-ecu2pRfmMZRhg/s400/3.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
6) From the "More items" link , a window is opened, to let you choose the mail merge fields :</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl06pAmGgxFrcAejFcCUCGWguFqrmXmz0MjSPZcEOj5vwaFHbXiSA4w1QJmPCKxuoJ5M2clGuaG2uNA3dEdtQSdFMgTFY7I5hTeUNvN2hwCulGj5hYaXZ3al6t1mlHyCLp1I0_-3wKG3w/s1600/4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="150" data-original-width="486" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl06pAmGgxFrcAejFcCUCGWguFqrmXmz0MjSPZcEOj5vwaFHbXiSA4w1QJmPCKxuoJ5M2clGuaG2uNA3dEdtQSdFMgTFY7I5hTeUNvN2hwCulGj5hYaXZ3al6t1mlHyCLp1I0_-3wKG3w/s400/4.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
7) After you finish your document/template, you will want to preview it:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijb8I9L7aGYjqBDgxh1bGPvc5Na-8C57FHw_70LJsAoDMsOEQuwRcCBbto-1wfJB1Jo7zWTt81RmR5Z-x-vHYNGocwarkh0txvFkH-ZQXN2zeW6EB4kkXhVRSTqxC5r9dpClBT3isYnuU/s1600/5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="900" data-original-width="1339" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijb8I9L7aGYjqBDgxh1bGPvc5Na-8C57FHw_70LJsAoDMsOEQuwRcCBbto-1wfJB1Jo7zWTt81RmR5Z-x-vHYNGocwarkh0txvFkH-ZQXN2zeW6EB4kkXhVRSTqxC5r9dpClBT3isYnuU/s400/5.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
8) Then, provided that everything is ok , just perform the mail merge. Else, go back with the navigation buttons, and edit again your document:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGH1n2L3BhGtYB7GHYxR2uyosnB9Zmi7keWsoWsJK16PYAdAE9cuUubwU-BHqfE7qODCG9ej31svZCnvMNtnGd3M13yKM4o8-Y0pXksB_nSPoygaglvYVf9oO73MwW4_cp7MkeH1524g4/s1600/9.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="77" data-original-width="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGH1n2L3BhGtYB7GHYxR2uyosnB9Zmi7keWsoWsJK16PYAdAE9cuUubwU-BHqfE7qODCG9ej31svZCnvMNtnGd3M13yKM4o8-Y0pXksB_nSPoygaglvYVf9oO73MwW4_cp7MkeH1524g4/s1600/9.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
9) Another thing: in case that you ALSO want to save your document as a template for future use, you can find it in <b>Dynamics 365 , </b>in the Settings, in the "Business" tab, inside "Templates":</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2C147SEOEh-bnI7HQZ8og0QSGuCMoxPTJ8sZvPz3frbFMGnrCfllDSx2sYKGjsGjY8BgzPLzEPuwSYB9marfPCmvismrO3Owt7HoMOv4tYbXg50wWmpvtHDXUEaaFI42ncAiZ_b3GA04/s1600/6.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="455" data-original-width="815" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2C147SEOEh-bnI7HQZ8og0QSGuCMoxPTJ8sZvPz3frbFMGnrCfllDSx2sYKGjsGjY8BgzPLzEPuwSYB9marfPCmvismrO3Owt7HoMOv4tYbXg50wWmpvtHDXUEaaFI42ncAiZ_b3GA04/s400/6.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both;">
In this article we saw How to create a Microsoft Word mail merge document with Dynamics 365 for Outlook.</div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...Enjoy Dynamics 365 CRM</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
</div>
</div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b>Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-40580723777756008402019-04-16T22:12:00.002-07:002019-04-16T22:12:12.552-07:00Dynamics 365 - How to Update Entity attributes using Web API and Javascript in 5 minutesIn this article we describe <b>Step by step How to Update Entity attributes using Web API and Javascript in 5 minutes.</b><br />
<b>In this example, we send an HTTP PATCH request to the Dynamics 365 Web Api, in order to update several attributes, and also a MANY-TO-ONE relationship reference between Phonecall and Contact.</b><br />
<b>We use the HTTP PATCH verb since we are updating more than ONE attribute. Elsewhere, we should use the HTTP PUT OData REST method.</b><b><br /></b><b><br /></b><br />
<h3 style="text-align: center;">
How to Update Entity attributes using Web API and Javascript in 5 minutes </h3>
<b><br /></b><b><br /></b><b>The following code sends an HTTP PATCH request to the Dynamics 365 Web Api, in order to update several attributes, and also a MANY-TO-ONE relationship reference between Phonecall and Contact:</b><b><br /></b><br />
<br />
<br />
var fnPATCHEntity = (newEntityId) => {<br />
//debugger;<br />
var entity = {};<br />
entity.phonenumber = document.getElementById("Phone").value; <br />
entity.description = document.getElementById("Description").value;<br />
entity["regardingobjectid_contact@odata.bind"] = "/contacts(" + newEntityId + ")";<br />
let id = parent.Xrm.Page.data.entity.getId().replace('{', '').replace('}', '');<br />
<br />
<br />
$.ajax({<br />
type: "PATCH",<br />
contentType: "application/json; charset=utf-8",<br />
datatype: "json",<br />
url: Xrm.Page.context.getClientUrl() + "/api/data/v8.2/phonecalls(" + id + ")",<br />
data: JSON.stringify(entity),<br />
beforeSend: function (XMLHttpRequest) {<br />
XMLHttpRequest.setRequestHeader("OData-MaxVersion", "4.0");<br />
XMLHttpRequest.setRequestHeader("OData-Version", "4.0");<br />
XMLHttpRequest.setRequestHeader("Accept", "application/json");<br />
},<br />
async: true,<br />
success: function (data, textStatus, xhr) {<br />
Xrm.Utility.alertDialog('Phonecall Updated with MANY-TO-ONE relationship!!');<br />
},<br />
error: function (xhr, textStatus, errorThrown) {<br />
Xrm.Utility.alertDialog(textStatus + " " + errorThrown);<br />
}<br />
});<br />
<br />
}<br />
<b><br /></b><b><br /></b><br />
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen Step by step How to Update Entity attributes using Web API and Javascript in 5 minutes.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-2843705087250143862019-04-16T06:21:00.000-07:002019-04-16T06:21:50.494-07:00Dynamics 365 - How to Create a MANY-TO-ONE related Entity record using Web API and Javascript in 5 minutesIn this article we describe <b>Step by step How to Create a MANY-TO-ONE related Entity record using Web API and Javascript in 5 minutes.</b><br />
<b>This Web Resource uses Bootstrap and JQuery , to issue HTTP POST and HTTP PATCH requests to a Dynamics 365 Organization, using the Web Api, in order to Create a new Contact record, related to a current Phonecall. </b><br />
<b><br /></b>
<b>The UI looks like this :</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsQ9VrqmnWtTLPBR4ArjOJosnKczKbnVLqKfMlpUw1cs3c85OvJ2Yft9Kir1V8HimFOil0i-pFQy67RMvrE-f59Nh6zPGj2HPE_dHB2hqOtoaz4vGGNMruRRkKRIro8b5pjXYHd0Cg1C8/s1600/5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="412" data-original-width="815" height="321" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsQ9VrqmnWtTLPBR4ArjOJosnKczKbnVLqKfMlpUw1cs3c85OvJ2Yft9Kir1V8HimFOil0i-pFQy67RMvrE-f59Nh6zPGj2HPE_dHB2hqOtoaz4vGGNMruRRkKRIro8b5pjXYHd0Cg1C8/s640/5.PNG" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglvqMay_ZV-kZLyQeNJWyCUzEkk55AcACR8lXd0dX6Wihs7v4E5B9lyN10_k-ponvuHWY0gBnAV0EKRfXNxzlJaOLaYVcOYt5Vope797DMi2hm7aC2A57SBRLLGriFPNNK3fmCHHyVvYg/s1600/6.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="727" data-original-width="875" height="331" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglvqMay_ZV-kZLyQeNJWyCUzEkk55AcACR8lXd0dX6Wihs7v4E5B9lyN10_k-ponvuHWY0gBnAV0EKRfXNxzlJaOLaYVcOYt5Vope797DMi2hm7aC2A57SBRLLGriFPNNK3fmCHHyVvYg/s400/6.PNG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ8KkkqJk_GB4mKnpkxKexplqs1ZNaAwfPmvgPhfbj0-DFrUgbpuyGuage0QMfFgp-PQp921STElZLyClQP-TzT-h0ENi8H6VtZQDEKiqzof277jb3cQ5cFQvuXsroTacxKFBK6LKodVk/s1600/9.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="308" data-original-width="686" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ8KkkqJk_GB4mKnpkxKexplqs1ZNaAwfPmvgPhfbj0-DFrUgbpuyGuage0QMfFgp-PQp921STElZLyClQP-TzT-h0ENi8H6VtZQDEKiqzof277jb3cQ5cFQvuXsroTacxKFBK6LKodVk/s400/9.PNG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg0s6yT4dYsexCYLkxhGmKa8nUxDj3o9PgXQ8syN6e-qzwM0nQpaSaEBjHPK_BY3HowMSayUMQeeMb1yCj52uaqAZkB5-l7oo1Uff8e0dtbIHm1yesVYVR1J7bTnBEaAuBEUaqXM4vBR4/s1600/7.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="500" data-original-width="533" height="375" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg0s6yT4dYsexCYLkxhGmKa8nUxDj3o9PgXQ8syN6e-qzwM0nQpaSaEBjHPK_BY3HowMSayUMQeeMb1yCj52uaqAZkB5-l7oo1Uff8e0dtbIHm1yesVYVR1J7bTnBEaAuBEUaqXM4vBR4/s400/7.PNG" width="400" /></a></div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><br />
<h3 style="text-align: center;">
How to Create a MANY-TO-ONE related Entity record using Web API and Javascript in 5 minutes </h3>
<b><br /></b><b><br /></b><b>There will be 2 functions, one for creating a new Contact record with HTTP POST , like this :</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR8qY6vq33nnxhMkQAeamPYTt2JK-UWsoGiWOJzTbfYer80nTeeqH9rqKb5aLKqOk1_1848MRgtpvJE7-arm7HQnJlw3z_PnFWvsl98C6iGm-VwJnvRVYvF0lhqi0QO-qo3usF8-h729w/s1600/9.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="308" data-original-width="686" height="284" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR8qY6vq33nnxhMkQAeamPYTt2JK-UWsoGiWOJzTbfYer80nTeeqH9rqKb5aLKqOk1_1848MRgtpvJE7-arm7HQnJlw3z_PnFWvsl98C6iGm-VwJnvRVYvF0lhqi0QO-qo3usF8-h729w/s640/9.PNG" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk4OVCW-EJ116iUtx86uhQvK34iO7tv9xh7_R7zOa_EiBqN19WK1Q2iogjrpFxTlyrdzGATUikVp4hQtpM9_UMmbPO5s6IKVZ12BL8-eyDedAQxf-02pBcxXkedhMxMPW9JIrcbobPcTE/s1600/10.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="308" data-original-width="689" height="284" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk4OVCW-EJ116iUtx86uhQvK34iO7tv9xh7_R7zOa_EiBqN19WK1Q2iogjrpFxTlyrdzGATUikVp4hQtpM9_UMmbPO5s6IKVZ12BL8-eyDedAQxf-02pBcxXkedhMxMPW9JIrcbobPcTE/s640/10.PNG" width="640" /></a></div>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b>And the second function, in order to UPDATE the current Phonecall record, setting its Contact reference regardingobjectid_contact to the guid of the newly created Contact :</b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSeqOOxvXLj-18_66SsSrcCDQ5ptqzkGtvhr6LJONhoU3Qkov8M_Y0TtEJgxOFZRO9lzovJ643E-9LY-SaaNOkUIXp_ARX4MDom_6JR72Tfa0hkxrRoPJxxNbt-9sLx29wsxOyQq8R3mo/s1600/8.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="329" data-original-width="693" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSeqOOxvXLj-18_66SsSrcCDQ5ptqzkGtvhr6LJONhoU3Qkov8M_Y0TtEJgxOFZRO9lzovJ643E-9LY-SaaNOkUIXp_ARX4MDom_6JR72Tfa0hkxrRoPJxxNbt-9sLx29wsxOyQq8R3mo/s640/8.PNG" width="640" /></a></div>
<b><br /></b>
<b><br /></b>
<br />
<br />
<b>The following is the whole Web Resource, to be copied as a building block to your Dynamics Organization :</b><br />
<br />
<br />
<html><br />
<head><br />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"><br />
<br />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"><br />
<script><br />
<br />
// Create a MANY-TO-ONE relationship : Créer une relation plusieurs-à-un phonecalls-contact :<br />
var fnPATCHRelatedEntity = (newEntityId) => {<br />
//debugger;<br />
var entity = {};<br />
entity["regardingobjectid_contact@odata.bind"] = "/contacts(" + newEntityId + ")";<br />
let id = parent.Xrm.Page.data.entity.getId().replace('{', '').replace('}', '');<br />
// In case you want to modify another attribute : Au cas ou tu veux modifier un autre attribut :<br />
// entity.phonenumber = "0546589251";<br />
<br />
parent.$.ajax({ // We can use HTTP PUT whenever we need to modify only ONE attribute<br />
type: "PATCH", // on peut utiliser le verbe HTTP PUT , dans le cas de modification de 1 seul attribut<br />
contentType: "application/json; charset=utf-8",<br />
datatype: "json",<br />
url: parent.Xrm.Page.context.getClientUrl() + "/api/data/v8.2/phonecalls(" + id + ")",<br />
data: JSON.stringify(entity),<br />
beforeSend: function (XMLHttpRequest) {<br />
XMLHttpRequest.setRequestHeader("OData-MaxVersion", "4.0");<br />
XMLHttpRequest.setRequestHeader("OData-Version", "4.0");<br />
XMLHttpRequest.setRequestHeader("Accept", "application/json");<br />
},<br />
async: true,<br />
success: function (data, textStatus, xhr) {<br />
parent.Xrm.Utility.alertDialog('Phonecall Updated with MANY-TO-ONE relationship!!');<br />
},<br />
error: function (xhr, textStatus, errorThrown) {<br />
parent.Xrm.Utility.alertDialog(textStatus + " " + errorThrown);<br />
}<br />
});<br />
<br />
}<br />
<br />
var fnCreateContact = () => {<br />
//debugger;<br />
var entity = {};<br />
entity.address1_telephone1 = document.getElementById("Phone").value;<br />
entity.emailaddress1 = document.getElementById("Email").value;<br />
entity.firstname = document.getElementById("FirstName").value;<br />
entity.lastname = document.getElementById("LastName").value;<br />
<br />
parent.$.ajax({<br />
type: "POST",<br />
contentType: "application/json; charset=utf-8",<br />
datatype: "json",<br />
url: parent.Xrm.Page.context.getClientUrl() + "/api/data/v8.2/contacts",<br />
data: JSON.stringify(entity),<br />
beforeSend: function (XMLHttpRequest) {<br />
XMLHttpRequest.setRequestHeader("OData-MaxVersion", "4.0");<br />
XMLHttpRequest.setRequestHeader("OData-Version", "4.0");<br />
XMLHttpRequest.setRequestHeader("Accept", "application/json");<br />
},<br />
async: true,<br />
success: function (data, textStatus, xhr) {<br />
let uri = xhr.getResponseHeader("OData-EntityId");<br />
let regExp = /\(([^)]+)\)/;<br />
let matches = regExp.exec(uri);<br />
let newEntityId = matches[1];<br />
if (newEntityId != null) {<br />
// Créer une relation plusieurs-à-un phonecalls-contact :<br />
fnPATCHRelatedEntity(newEntityId);<br />
}<br />
<br />
<br />
document.getElementById('btnCreateContact').classList.add('disabled');<br />
},<br />
error: function (xhr, textStatus, errorThrown) {<br />
parent.Xrm.Utility.alertDialog(textStatus + " " + errorThrown);<br />
}<br />
});<br />
}<br />
<br />
<br />
</script><br />
<br />
</head><br />
<body style="direction: rtl; overflow-wrap: break-word;"><br />
<br />
<div class="container"><br />
<div class="jumbotron"><br />
<h3>Create Contact</h3><br />
<p></p><h5>This function creates a new Contact related to the current Phonecall through a One-To-Many relationship</h5><p></p><br />
<table style="font:12px;border-spacing:3px;margin:5px;"><br />
<tbody><br />
<tr><br />
<td>First Name: </td><br />
<td><input type="text" id="FirstName" value="Bender"></td><br />
</tr><br />
<tr><br />
<td>Last Name: </td><br />
<td><input type="text" id="LastName" name="LastName" value="Rodriguez"></td><br />
</tr><br />
<tr><td>Email: </td><td><input type="text" id="Email" value="www.bender.com"></td></tr><br />
<tr><br />
<td>Phone: </td><br />
<td><input type="text" id="Phone" name="Phone" value="123456789"></td><br />
</tr><br />
</tbody><br />
</table><br />
<br />
<button id="btnCreateContact" onclick="fnCreateContact()" type="button" class="btn btn-primary">Create Contact</button><br />
<br />
</div><br />
</div><br />
</body><br />
</html><br />
<br />
<br />
<br />
<br />
<br />
<br />
<b><br /></b><b><br /></b><br />
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen Step by step How to Create a MANY-TO-ONE related Entity record using Web API and Javascript in 5 minutes.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-2893974133153622442019-04-16T02:07:00.001-07:002019-04-16T02:07:13.992-07:00SOLVED ERROR - Cannot find assembly "Microsoft.SqlServer.ManagedDTS" when calling an SSIS agent job from C# code<div class="separator" style="clear: both; text-align: center;">
<br /></div>
In this article we describe h<b>ow to find the assembly "Microsoft.SqlServer.ManagedDTS" when calling an SSIS agent job from C# code.</b><br />
<b><br /></b>When calling an Sql Server Integration Services agent job SSIS programmatically from C# .Net code, in order to use the method Execute , there is a need for using in the application the reference to the assembly Microsoft.SqlServer.ManagedDTS .<br />
<br />
The problem resides in finding that DLL . It should be installed in the pc, together with the rest of SQL SERVER DLLs.<br />
<br />
<b><br /></b>
<br />
<h3 style="text-align: center;">
How <b style="font-size: medium; text-align: start;">to find the assembly "Microsoft.SqlServer.ManagedDTS" when calling an SSIS agent job from C# code</b></h3>
<br />
<br />
The first try will be to add the assembly via the assemblies list box in visual studio , only to find that it was not available there:<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1MSZd-zNu7vGRLRcLSTswjKC2p_rmVTxarJIIPtnpscMSpgJ0CdV_YSE_shIUB1Zp_XLLHAZgMMNTCUHC_LcBmbGK735luY8XvNLTqldIou-5unHVR68i1LjXB8e9HmlBoktbK5w_4qY/s1600/0.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="542" data-original-width="781" height="277" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1MSZd-zNu7vGRLRcLSTswjKC2p_rmVTxarJIIPtnpscMSpgJ0CdV_YSE_shIUB1Zp_XLLHAZgMMNTCUHC_LcBmbGK735luY8XvNLTqldIou-5unHVR68i1LjXB8e9HmlBoktbK5w_4qY/s400/0.PNG" width="400" /></a><br />
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGzZrE3mFyxFDwLOG07CWx_Iw9VqzFgVgT0y7Z9Rtd-mYSte6FLrSyjefFpTh8BIm0TSESjrGgVgS5v4E88PKUTpdVU7JU2OOOf59Mo79_9vfjkbwvAmcj81xZXas0JGDmZ-kRabmArhU/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="549" data-original-width="798" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGzZrE3mFyxFDwLOG07CWx_Iw9VqzFgVgT0y7Z9Rtd-mYSte6FLrSyjefFpTh8BIm0TSESjrGgVgS5v4E88PKUTpdVU7JU2OOOf59Mo79_9vfjkbwvAmcj81xZXas0JGDmZ-kRabmArhU/s400/1.png" width="400" /></a><br />
<br />
Then, we could go to the SQL SERVER assemblies folder : C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies<br />
Again, it will not be possible to get the assembly that way:<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHlw-F99AaWHxNJI6WZs1bkK4YNtc5JUmHAW3gogyq1DgPwOdIPSRd1AeNNzcLK190z4jZIsUEWnqwhGCwfKZYAWZ1SngXT3vJP2kdj1Qq0eD8rw_RO_aXf3AGuAim9aMtauqDpadzTTM/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="244" data-original-width="734" height="132" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHlw-F99AaWHxNJI6WZs1bkK4YNtc5JUmHAW3gogyq1DgPwOdIPSRd1AeNNzcLK190z4jZIsUEWnqwhGCwfKZYAWZ1SngXT3vJP2kdj1Qq0eD8rw_RO_aXf3AGuAim9aMtauqDpadzTTM/s400/2.PNG" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
SOLUTION: </div>
<div>
Press WIN KEY + R to open the Run window , and run the GAC command : </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOpnrcKzkqgrI3dZQxTjhOrbbj6GIacSeO8JSKKMwxwpSdXhWZrPMm9cSNr5JBHmlexTgN0T0UttEAdoLuEfAm8sJRQI6dapqUv9gMkxKfR1kO5r8-qQAN4kLkSI5gsQ5380HIazODT9o/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="263" data-original-width="809" height="130" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOpnrcKzkqgrI3dZQxTjhOrbbj6GIacSeO8JSKKMwxwpSdXhWZrPMm9cSNr5JBHmlexTgN0T0UttEAdoLuEfAm8sJRQI6dapqUv9gMkxKfR1kO5r8-qQAN4kLkSI5gsQ5380HIazODT9o/s400/3.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
C:\Windows\assembly\gac_msil<br />
<br />
<br />
The GAC will open, and then make a search for the ManagedDTS assembly :<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmDhOVOOgVVDf9-LE2O27TE40REy6j4zIjWiA2yS8ZKbyfs-rHDRw6Qzc5Crl8YyoNsgWjSZ_eC4-AShxjEHJtnLA-IJxajfoQlYeO1Nmgs4xjeB0wU86i3X0pjjJgVOkndqb3My6Bo28/s1600/4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="952" data-original-width="556" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmDhOVOOgVVDf9-LE2O27TE40REy6j4zIjWiA2yS8ZKbyfs-rHDRw6Qzc5Crl8YyoNsgWjSZ_eC4-AShxjEHJtnLA-IJxajfoQlYeO1Nmgs4xjeB0wU86i3X0pjjJgVOkndqb3My6Bo28/s400/4.PNG" width="232" /></a></div>
<div>
<br /></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAZbQ77NK3UUyjGYpwRgS1lbOxOoOYQpxy6dBMKwuqbjiDpxJnnQboKKEOH7BNZsAOYVdAGhuNuHigeU9H-y3KeiRLB3TOfHQX01RHG2tTWXWaNxdsGPmOah7brdwm5xYmbj46gIf9UQ8/s1600/5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="357" data-original-width="1277" height="111" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAZbQ77NK3UUyjGYpwRgS1lbOxOoOYQpxy6dBMKwuqbjiDpxJnnQboKKEOH7BNZsAOYVdAGhuNuHigeU9H-y3KeiRLB3TOfHQX01RHG2tTWXWaNxdsGPmOah7brdwm5xYmbj46gIf9UQ8/s400/5.PNG" width="400" /></a></div>
<div>
Copy it to the BIN folder of your VISUAL STUDIO project, then open the reference manager and BROWSE for it in the BIN folder :</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidVclIDZdZfM9zap7INQEnjL83gDj-jKwu95U2x0beyhnW_s8a_-hdB5bKds0InDgoSGjLAsUypWk8YtUuURXFuamhyEkNokeF1pve2VdOEaeHQ-B1_sBLOQZfrj0xEDLqyLDlipIus4M/s1600/6.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="860" data-original-width="522" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidVclIDZdZfM9zap7INQEnjL83gDj-jKwu95U2x0beyhnW_s8a_-hdB5bKds0InDgoSGjLAsUypWk8YtUuURXFuamhyEkNokeF1pve2VdOEaeHQ-B1_sBLOQZfrj0xEDLqyLDlipIus4M/s320/6.PNG" width="194" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHeq-1icdrx-7c25-bZz0USk6jLfNT4Hvh8C8vLXLFw4iK53K0C3Vm6wT556IDPOQ_oTJcJUu9ilyvPInja_IPWu6z8DhSxAvZc2deQ99M65Zsh9YqEDJ5VRuSD6KoWsJOmGX45WWpp6M/s1600/7.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="259" data-original-width="508" height="163" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHeq-1icdrx-7c25-bZz0USk6jLfNT4Hvh8C8vLXLFw4iK53K0C3Vm6wT556IDPOQ_oTJcJUu9ilyvPInja_IPWu6z8DhSxAvZc2deQ99M65Zsh9YqEDJ5VRuSD6KoWsJOmGX45WWpp6M/s320/7.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKjUbVaeH2n9r-h7BC6dp6odIfBAFV8IAH6uZCI3uG_3QkFR-A1VIAJ3e7gyN0rCd8qnPmoErpjcd7eEgSoSyyg_3jZk_BODd22virLux2tziKh50SlpOFZRONA-axfyB3AHuCyEwHkqs/s1600/8.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="258" data-original-width="458" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKjUbVaeH2n9r-h7BC6dp6odIfBAFV8IAH6uZCI3uG_3QkFR-A1VIAJ3e7gyN0rCd8qnPmoErpjcd7eEgSoSyyg_3jZk_BODd22virLux2tziKh50SlpOFZRONA-axfyB3AHuCyEwHkqs/s320/8.PNG" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Add the "Using" reference to your Project .</div>
<div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen Step by step how to find the assembly "Microsoft.SqlServer.ManagedDTS" when calling an SSIS agent job from C# code.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
</div>
</div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b></div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com1tag:blogger.com,1999:blog-7170990797045135567.post-2444942606424490082019-04-16T01:57:00.001-07:002019-04-16T01:57:28.648-07:00Dynamics 365 - How to Create a new Entity record using Web API and Javascript in 5 minutesIn this article we describe <b>Step by step How to Create a new Entity record using Web API and Javascript in 5 minutes. </b>We'll use the JQuery already loaded by Dynamics 365 on the form.<br />
<b><br /></b>
For this example, we'll create a Contact record, when clicking a button, using a Web Resource locally inside the Form.<br /><b><br /></b><br />
<h3 style="text-align: center;">
How to Create a new Entity record using Web API and Javascript in 5 minutes</h3>
<b><br /></b>
<b><br /></b>
<b>This is the function to Create a Record , using an HTTP POST request: </b><br />
<b><br /></b>
<b><br /></b>
var entity = {};<br />
entity.address1_telephone1 = "";<br />
entity.emailaddress1 = "";<br />
entity.lastname = "";<br />
<br />
$.ajax({<br />
type: "POST",<br />
contentType: "application/json; charset=utf-8",<br />
datatype: "json",<br />
url: Xrm.Page.context.getClientUrl() + "/api/data/v8.2/contacts",<br />
data: JSON.stringify(entity),<br />
beforeSend: function(XMLHttpRequest) {<br />
XMLHttpRequest.setRequestHeader("OData-MaxVersion", "4.0");<br />
XMLHttpRequest.setRequestHeader("OData-Version", "4.0");<br />
XMLHttpRequest.setRequestHeader("Accept", "application/json");<br />
},<br />
async: true,<br />
success: function(data, textStatus, xhr) {<br />
var uri = xhr.getResponseHeader("OData-EntityId");<br />
var regExp = /\(([^)]+)\)/;<br />
var matches = regExp.exec(uri);<br />
var newEntityId = matches[1];<br />
},<br />
error: function(xhr, textStatus, errorThrown) {<br />
Xrm.Utility.alertDialog(textStatus + " " + errorThrown);<br />
}<br />
});<br />
<br />
<br />
<br />
<b>And this is the Web Resource EMBEDDED in the Form (that's why we wrote "parent" before calls to JQuery ) :</b><br />
1) Open the Form<br />
2) Add > Section > Web Resource<br />
3) Paste inside it the following HTML - JS code:<br />
<br />
<br />
<br />
<html><head><br />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"><br />
<br />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"><br />
<script><br />
<br />
var fnCreateContact = () => {<br />
var entity = {};<br />
entity.address1_telephone1 = "123123123";<br />
entity.emailaddress1 = "www.bender.com";<br />
entity.lastname = "Contact Name";<br />
<br />
parent.$.ajax({<br />
type: "POST",<br />
contentType: "application/json; charset=utf-8",<br />
datatype: "json",<br />
url: parent.Xrm.Page.context.getClientUrl() + "/api/data/v8.2/contacts",<br />
data: JSON.stringify(entity),<br />
beforeSend: function(XMLHttpRequest) {<br />
XMLHttpRequest.setRequestHeader("OData-MaxVersion", "4.0");<br />
XMLHttpRequest.setRequestHeader("OData-Version", "4.0");<br />
XMLHttpRequest.setRequestHeader("Accept", "application/json");<br />
},<br />
async: true,<br />
success: function(data, textStatus, xhr) {<br />
var uri = xhr.getResponseHeader("OData-EntityId");<br />
var regExp = /\(([^)]+)\)/;<br />
var matches = regExp.exec(uri);<br />
var newEntityId = matches[1];<br />
<br />
document.getElementById('btnCreateContact').classList.add('disabled');<br />
},<br />
error: function(xhr, textStatus, errorThrown) {<br />
parent.Xrm.Utility.alertDialog(textStatus + " " + errorThrown);<br />
}<br />
});<br />
}<br />
</script><br />
<meta></head><body style="direction: rtl; overflow-wrap: break-word;"><br />
<br />
<div class="container"><br />
<div class="jumbotron"><br />
<h3>Create Contact</h3> <br />
<p>This function creates a new Contact</p><br />
<button id="btnCreateContact" onclick="fnCreateContact()" type="button" class="btn btn-primary">Create Contact</button><br />
</div><br />
</div><br />
<br />
</body></html><br />
<br />
<br />
<b><br /></b><b><br /></b><br />
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen Step by step How to Create a new Entity record using Web API and Javascript in 5 minutes.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-63053212620084918062019-04-16T01:47:00.000-07:002019-04-16T01:47:00.255-07:00Step by step How to Install the CRM REST Builder in your Dynamics CRM 365 in 5 minutesIn this article we describe <b>Step by step </b><b>How to Install the CRM REST Builder in your Dynamics CRM 365 in 5 minutes.</b><br />
The CRM REST Builder is an open source creation by Jason Lattimer. It will give you the chance of getting the REST OData code that you need, both using JQuery or XMLHttpRequest, automatically and avoiding to fall on errors. The Builder enables you to perform WEB API OData REST request to create One to Many , Many to One and Many to Many relationships, asynchronously:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9SIPEXM86B58BJoPpEYQOxvQDRxQbuhAU77zBWIw6twPvlB7TZCEs94hPq36PbZQQ-0jxuTR46cDluJWiccd_RK5VJTDKrZ5a8KUKahbr0qSHUffOyHLvlqZKEtRo1bD27oMkR-0Wfio/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="528" data-original-width="881" height="382" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9SIPEXM86B58BJoPpEYQOxvQDRxQbuhAU77zBWIw6twPvlB7TZCEs94hPq36PbZQQ-0jxuTR46cDluJWiccd_RK5VJTDKrZ5a8KUKahbr0qSHUffOyHLvlqZKEtRo1bD27oMkR-0Wfio/s640/3.PNG" width="640" /></a></div>
<b><br /></b><b><br /></b><br />
<h3 style="text-align: center;">
How to Install the CRM REST Builder in your Dynamics CRM 365 in 5 minutes</h3>
<b>1) Download the REST BUILDER:</b><br />
Browse to the Jason Lattimer's Github , and download the Builder , according to your Dynamics CRM version: <a href="https://github.com/jlattimer/CRMRESTBuilder/releases" target="_blank">https://github.com/jlattimer/CRMRESTBuilder/releases</a><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgeTSWa1HbwVMMy0zkvnsNxAs0BATCsda9kJ3k0DwVa1vJWVms-hRc6ybpWmRpxiPM-FT-F8THc-Euj8Yb5mLVwN8UB-PXiKYT4giZl5_wx2lidZaWoePZ6lsSXlf3_U8dhHswpMx6jPo/s1600/0.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="938" data-original-width="1008" height="594" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgeTSWa1HbwVMMy0zkvnsNxAs0BATCsda9kJ3k0DwVa1vJWVms-hRc6ybpWmRpxiPM-FT-F8THc-Euj8Yb5mLVwN8UB-PXiKYT4giZl5_wx2lidZaWoePZ6lsSXlf3_U8dhHswpMx6jPo/s640/0.PNG" width="640" /></a></div>
<b><br /></b>
<b>2) Import the Managed Solution to your Dynamics 365:</b><br />
Open your solutions screen, and import the REST Builder solution:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRDUYQTc5ZX3Zm5rCgudtacnFLTuqx8KYfGCkFlWQGiLq70J0Xahk-cxogN8xrD89epBvRUMi513EajPsKtLTvLgL6gh9ulBtsVVRWE6xDXKgR2csbwh0YKqEOocpbkrTJskf0L3b9fQU/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="28" data-original-width="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRDUYQTc5ZX3Zm5rCgudtacnFLTuqx8KYfGCkFlWQGiLq70J0Xahk-cxogN8xrD89epBvRUMi513EajPsKtLTvLgL6gh9ulBtsVVRWE6xDXKgR2csbwh0YKqEOocpbkrTJskf0L3b9fQU/s1600/1.PNG" /></a></div>
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b>3) Open the REST BUILDER:</b><br />
After refreshing the Solutions form, you will see a button on the top of the form. Open it to see the Builder:<br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjNnPERZMERsINIRIMihrVtP0TmGTbVy5dJksVNok8SiSI-5hGBRFeptTtklRfFPXF2VypcEFDXitH2VoYmyIn_GX_N1s1CRkLcvjj4YXGbFgme500DJeyiQOZk92UU944cpS9YNm2JfA/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="148" data-original-width="465" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjNnPERZMERsINIRIMihrVtP0TmGTbVy5dJksVNok8SiSI-5hGBRFeptTtklRfFPXF2VypcEFDXitH2VoYmyIn_GX_N1s1CRkLcvjj4YXGbFgme500DJeyiQOZk92UU944cpS9YNm2JfA/s400/2.PNG" width="400" /></a></div>
<b><br /></b>
<b><br /></b>
<b><br />4) Create your REST request:</b><br />
Create your request, and copy it to the web resource that will be called from your entity form:<br />
<b><br /></b>
<b><br /></b>
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6uhh8JdMiLWEatHoUnVCBImeL3lYeRqgu1sIsT41EmXA179MtSMbV1RHQuyHJ1PCvUhyGIEwsGMbRhv9YV4cO7Es0HtfubcO2BMnHWZjVl0iR2Tk3Kh3jd0liKEf-WUGtEM077GSiNHI/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="528" data-original-width="881" height="380" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6uhh8JdMiLWEatHoUnVCBImeL3lYeRqgu1sIsT41EmXA179MtSMbV1RHQuyHJ1PCvUhyGIEwsGMbRhv9YV4cO7Es0HtfubcO2BMnHWZjVl0iR2Tk3Kh3jd0liKEf-WUGtEM077GSiNHI/s640/3.PNG" width="640" /></a></div>
<br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhyU91rPjL0aojXN_YrzrNWOTNa2kDwgxgRiN3PnbX2ZBBCduV6XEooLcfpN3OE4ebAaHMJCDFX5Fe-Xj9g7QmZVwxWk2Sv0tYYFjeqYfJG31FTkStHN1eAnVgesPx3LM6LFddFoSaU1g/s1600/4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="640" data-original-width="861" height="474" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhyU91rPjL0aojXN_YrzrNWOTNa2kDwgxgRiN3PnbX2ZBBCduV6XEooLcfpN3OE4ebAaHMJCDFX5Fe-Xj9g7QmZVwxWk2Sv0tYYFjeqYfJG31FTkStHN1eAnVgesPx3LM6LFddFoSaU1g/s640/4.PNG" width="640" /></a></div>
<br />
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen <b>Step by step </b><b>How to Install the CRM REST Builder in your Dynamics CRM 365 in 5 minutes</b>.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
</div>
</div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b>Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com7tag:blogger.com,1999:blog-7170990797045135567.post-84209518229249907592019-04-10T23:39:00.001-07:002019-04-10T23:39:23.003-07:00Dynamics 365 - How to Retrieve Many-To-One related Entity attributes using Web API and JavascriptIn this article we describe <b>Step by step How to Retrieve Many-To-One related Entity attributes using Web API and Javascript in 5 minutes. We use the JQuery included in the Dynamics form.</b><br />
This is our example : we want to get attributes from a Contact related to a Phonecall :<br />
This is a MANY-TO-ONE relationship, therefore :<br />
<b>Primary Entity = Contact</b><br />
<b>Related Entity = Phonecall</b><b><br /></b><b>Link Entity = regardingobjectid_phonecall_contact </b><br />
<b> (</b>this logical name can be inferred from the N:1 link as seen in the Customizations : see this snapshot : <b>)</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6I5SOYwY-4f77zpWw8L_PlmkQgtsbmtK2238KHtwbf81QUGw9P1ZWSJ_uOQEKOzuaf9Ow_1DhMwg71ibfceo8383Fe5ZhnruDZ63xI3JsSJgnVwN94qUV_bYcyBAfbu37jyi-IZY-v0Y/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="185" data-original-width="259" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6I5SOYwY-4f77zpWw8L_PlmkQgtsbmtK2238KHtwbf81QUGw9P1ZWSJ_uOQEKOzuaf9Ow_1DhMwg71ibfceo8383Fe5ZhnruDZ63xI3JsSJgnVwN94qUV_bYcyBAfbu37jyi-IZY-v0Y/s1600/1.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWqShBFqm9rV-JZSDq9nLzU964B4Yy_-9TpN4RzaFvkSs-QNbuMXfqRVGpdYkLnyuTITMhdwihj3aRX6ncGiY_6NzoA8NE78BEu26EVXowSVj9UtDRa6yR5HVqoMuAmF4WKn68suunZmk/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="80" data-original-width="629" height="40" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWqShBFqm9rV-JZSDq9nLzU964B4Yy_-9TpN4RzaFvkSs-QNbuMXfqRVGpdYkLnyuTITMhdwihj3aRX6ncGiY_6NzoA8NE78BEu26EVXowSVj9UtDRa6yR5HVqoMuAmF4WKn68suunZmk/s320/2.PNG" width="320" /></a></div>
<b><br /></b><b><br /></b><b><br /></b><br />
<h3 style="text-align: center;">
How to Retrieve Many-To-One related Entity attributes using Web API and Javascript </h3>
<b><br /></b><b><br /></b><b>This approach works by creating only one web resource embedded into the Form HTML page of the entity :</b><br />
<b>1) Open the Form - Add a new Region</b><br />
<b>2) Add a Web Resource to the Region</b><br />
<b>3) Click on Create New Web Resource </b><br />
<b>4) Add the following Building Block code to the Web Resource :</b><br />
<b><br /></b>
This code:<br />
- loads Bootstrap<br />
- uses JQuery form the Parent Form<br />
- Gets Attributes from both the current Entity (Phonecall) + the related MANY-TO-ONE Entity (Contact) :<br />
<br />
<br />
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<html><head></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<script> </div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
function fnGetContactDetails() {</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
debugger;</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
let gPrimaryEntityId = parent.Xrm.Page.data.entity.getId();</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
if (gPrimaryEntityId) {</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
gPrimaryEntityId = gPrimaryEntityId.replace("{", "").replace("}", "");</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
parent.$.ajax({</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
type: "GET",</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
contentType: "application/json; charset=utf-8",</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
datatype: "json",</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
url: encodeURI(parent.Xrm.Page.context.getClientUrl() + "/api/data/v8.2/phonecalls(" + gPrimaryEntityId + ")?$select=activityid,phonenumber&$expand=regardingobjectid_contact_phonecall($select=contactid,fullname,accountrolecode,emailaddress1,telephone1,mobilephone,company)"),</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
beforeSend: function (XMLHttpRequest) {</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
XMLHttpRequest.setRequestHeader("OData-MaxVersion", "4.0");</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
XMLHttpRequest.setRequestHeader("OData-Version", "4.0");</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
XMLHttpRequest.setRequestHeader("Accept", "application/json");</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
XMLHttpRequest.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
},</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
async: true,</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
success: function (data, textStatus, xhr) {</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
var result = data;</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
var activityid = result["activityid"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
var phonenumber = result["phonenumber"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
if (result.hasOwnProperty("regardingobjectid_contact_phonecall")) {</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
var contactid = result["regardingobjectid_contact_phonecall"]["contactid"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
var fullname = result["regardingobjectid_contact_phonecall"]["fullname"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
let accountrolecode = result["regardingobjectid_contact_phonecall"]["accountrolecode"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
let emailaddress1 = result["regardingobjectid_contact_phonecall"]["emailaddress1"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
let telephone1 = result["regardingobjectid_contact_phonecall"]["telephone1"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
let company = result["regardingobjectid_contact_phonecall"]["company"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
let mobilephone = result["regardingobjectid_contact_phonecall"]["mobilephone"];</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
document.getElementById("msg").innerHTML = fullname + "<br>" + // accountrolecode + "<br>" + </div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
emailaddress1 + "<br>" + telephone1 + "<br>" + company + "<br>" + mobilephone;</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
document.getElementById("btnGetContact").style.display = "none";</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
// parent.Xrm.Utility.alertDialog(fullname);</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
}</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
},</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
error: function (xhr, textStatus, errorThrown) {</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
parent.Xrm.Utility.alertDialog(textStatus + " " + errorThrown);</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
}</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
});</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
}</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
else {</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
parent.Xrm.Page.ui.alert("No ID for Primary Entity");</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
}</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
}</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
</script></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta></head><body style="direction: rtl; overflow-wrap: break-word;"></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<div class="container"></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<div class="jumbotron"></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<h3>Contact Details</h3> </div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<button id="btnGetContact" class="btn btn-secondary" onclick="fnGetContactDetails()">Get Contact Details </button> </div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<b><div id="msg"></div></b> </div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
</div></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
<br /></div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
</div></body></html> </div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
</div>
<div style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small;">
}</div>
<b><br /></b>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ6rbjGfopU0IvuKhaqFjXoidFaGwXSt3pz3tMYrcgj3_UJUDQwENPDrvAaxdmHyMxHuSDVPTdd7c9q2degOUboEfLvQubJoixFMYuFyDIFVNW2N0ycB5Xhf3z7SgN4t-sEbVRUUIDRNY/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="80" data-original-width="629" height="80" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ6rbjGfopU0IvuKhaqFjXoidFaGwXSt3pz3tMYrcgj3_UJUDQwENPDrvAaxdmHyMxHuSDVPTdd7c9q2degOUboEfLvQubJoixFMYuFyDIFVNW2N0ycB5Xhf3z7SgN4t-sEbVRUUIDRNY/s640/2.PNG" width="640" /></a></div>
<b><br /></b><b><br /></b><br />
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen Step by step How to Retrieve Many-To-One related Entity attributes using Web API and Javascript in 5 minutes.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-42023047176901025232019-02-10T22:31:00.000-08:002019-02-10T22:31:56.168-08:00How to re-enable the Dynamics 365 for Outlook Client in OutlookIn this article we describe <b>Step by step </b><b>How to re-enable the Dynamics 365 for Outlook Client in Outlook.</b><br />
<h3 style="text-align: center;">
How <b>to re-enable the Dynamics 365 for Outlook Client in Outlook</b></h3>
<br />
In case that your Outlook crashed because of some <b>Dynamics 365 for Outlook Client ,</b> while reloading Outlook, you will be prompted to disable the add-in that caused the problem.<br />
<br />
Usually, the <b>Dynamics 365 for Outlook Client</b> addon will be disabled.<br />
The problem is, how to re-enable it?<br />
<br />
The solution is, by opening the <b>Dynamics 365 for Outlook Client </b>Diagnostics window.<br />
<br />
To do so, go to the Start , Programs, and locate the Diagnostics:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic0ZGAsYKtR0CpbrDeuwfxG2ARB69oydiXxvvVSKH32coVGAGz8MrczruSHW4GBH4pe-jonBRW2fbe0F46M5rZ9skIvyRWUObOMujYueSWqp9-dQmkAFsc94VJHM6lMkdi7dQhgqgtoBE/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="417" data-original-width="259" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic0ZGAsYKtR0CpbrDeuwfxG2ARB69oydiXxvvVSKH32coVGAGz8MrczruSHW4GBH4pe-jonBRW2fbe0F46M5rZ9skIvyRWUObOMujYueSWqp9-dQmkAFsc94VJHM6lMkdi7dQhgqgtoBE/s320/1.PNG" width="198" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
On the opened window, go to the second tab "Advanced" :</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC_IXhMGrThpojmukZ8Ha7CJHLCF3O-Ex8omtCSmg3fF_H39UHAmKK5YgbPHrFI6EpRhVfyV2JncoM7Rn2foIWRCvWlYJvCrmrNNAui2-xte1OhIiK-eVxQNYWoTAQaCBuYfgEjxPKhR8/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="540" data-original-width="606" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC_IXhMGrThpojmukZ8Ha7CJHLCF3O-Ex8omtCSmg3fF_H39UHAmKK5YgbPHrFI6EpRhVfyV2JncoM7Rn2foIWRCvWlYJvCrmrNNAui2-xte1OhIiK-eVxQNYWoTAQaCBuYfgEjxPKhR8/s320/2.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In the "Advanced" tab, click on "Enable" :</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJaR4j_NMhCZCt6AD_yMCRpf5UIbQPsr_x6MABi4yC33Cg8OMWRvYVbL2tDGva1BnziLRq5X8xCTbwAXu09DsU23GN4AIDOABYxDxxAo9MmytRjVWk6y-9Qf99ttIQzBZWuvRhmaG4u-Y/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="546" data-original-width="628" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJaR4j_NMhCZCt6AD_yMCRpf5UIbQPsr_x6MABi4yC33Cg8OMWRvYVbL2tDGva1BnziLRq5X8xCTbwAXu09DsU23GN4AIDOABYxDxxAo9MmytRjVWk6y-9Qf99ttIQzBZWuvRhmaG4u-Y/s320/3.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Reopen Outlook , and the <b>Dynamics 365 for Outlook Client will be there.</b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...Enjoy Dynamics CRM</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
</div>
</div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b>Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-54331300903894401442018-10-21T18:30:00.000-07:002020-01-14T21:50:52.040-08:00SOLVED ERROR "File already exists" when configuring Microsoft Dynamics CRM for OutlookIn this article we describe <b>Step by step How to solve the error "File already exists" when configuring Microsoft Dynamics CRM for Outlook.</b><br />
<b><br /></b>
<br />
This error can appear as follows:<br />
"There is a problem communicating with the Microsoft Dynamics CRM server. The server might be unavailable. Try again later. If the problem persists, contact your system administrator.<br />
File already exists. Try using a different database name."<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHl_A8mpIiaMwK4RVlceWw2av5t-7DSCyNukgxPArJG586D4tHDK_kDFw3yDV-43pC-BfA65RyuXWBHvmUSCKcYgNxArysgH69c-vJdH1-9Zclr16zFn70HQ8jEe-S4Gl2gvTIxorxY3Y/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="479" data-original-width="419" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHl_A8mpIiaMwK4RVlceWw2av5t-7DSCyNukgxPArJG586D4tHDK_kDFw3yDV-43pC-BfA65RyuXWBHvmUSCKcYgNxArysgH69c-vJdH1-9Zclr16zFn70HQ8jEe-S4Gl2gvTIxorxY3Y/s320/3.PNG" width="279" /></a></div>
<br />
<br />
<br />
<br />
<h3>
<span style="font-size: small; text-align: start;">How to solve the error "File already exists" when configuring Microsoft Dynamics CRM for Outlook</span></h3>
The cause of this error, is related to succesive installations of Microsoft Dynamics CRM for Outlook.<br />
Having a previous installation of Dynamics CRM for Outlook, can result in an existing previous configuration of the database file for the current Dynamics instance.<br />
In order to solve this problem, follow this steps:<br />
1) Close Outlook<br />
2) In Explorer, go to the folder <b> :\Users\<Your User>\AppData</b> :<br />
<br />
<br />
<br class="separator" div="" style="clear: both; text-align: center;" />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsRIBH0gnJNZNDKYaILtIgOUWG8l8GUMB3oXyreir6defDm67pOxOWoPe-LPuSyDaTA928DPUOdztLR5ZLKlwCyjYvbJY0usSJjqvcuWXHrGVzu4iX4BHE4JywI2jcs7dF77QSGECRDm0/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="143" data-original-width="651" height="87" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsRIBH0gnJNZNDKYaILtIgOUWG8l8GUMB3oXyreir6defDm67pOxOWoPe-LPuSyDaTA928DPUOdztLR5ZLKlwCyjYvbJY0usSJjqvcuWXHrGVzu4iX4BHE4JywI2jcs7dF77QSGECRDm0/s400/1.PNG" width="400" /></a>
<br />
<br />
<br />
<br />
<br />
3) In Windows, this folder is hidden by default. If that's your case, open the "Folder and search options" :<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzaOYh22R91oeuREO0EhoLYlup5-jElNAUrZNrotckDvDGhGX_z4Bp1kupotpCc8OMDv13LygxskCWuteWYoe5PReTMNEi09-BA9_weA8ScfgwJsHIWII1mnGXa0zzIcj_Qs2qXsm3B-M/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="353" data-original-width="235" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzaOYh22R91oeuREO0EhoLYlup5-jElNAUrZNrotckDvDGhGX_z4Bp1kupotpCc8OMDv13LygxskCWuteWYoe5PReTMNEi09-BA9_weA8ScfgwJsHIWII1mnGXa0zzIcj_Qs2qXsm3B-M/s320/2.PNG" width="212" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
4) In the window "Folder Options", check on "Show hidden files, folders and drives":</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHl_A8mpIiaMwK4RVlceWw2av5t-7DSCyNukgxPArJG586D4tHDK_kDFw3yDV-43pC-BfA65RyuXWBHvmUSCKcYgNxArysgH69c-vJdH1-9Zclr16zFn70HQ8jEe-S4Gl2gvTIxorxY3Y/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="479" data-original-width="419" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHl_A8mpIiaMwK4RVlceWw2av5t-7DSCyNukgxPArJG586D4tHDK_kDFw3yDV-43pC-BfA65RyuXWBHvmUSCKcYgNxArysgH69c-vJdH1-9Zclr16zFn70HQ8jEe-S4Gl2gvTIxorxY3Y/s320/3.PNG" width="279" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
5) Now, you could see the <b>\AppData</b> directory. Open it and browse to <b>\AppData\Local\Microsoft\MSCRM\Client :</b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaDVlHKmNobYhWMw1IaOvAEVKz8giY5yHao3Rq9TRuY6PiGwQ6XD0WdGTKXnoG5rMhvkSeqgQnS1xMlQdY7-xF9_ZyhV99opZtgkrO77X1JMO8PjzJXFNntBLBKAeEQC_4-IGmRq22Szw/s1600/4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="144" data-original-width="1039" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaDVlHKmNobYhWMw1IaOvAEVKz8giY5yHao3Rq9TRuY6PiGwQ6XD0WdGTKXnoG5rMhvkSeqgQnS1xMlQdY7-xF9_ZyhV99opZtgkrO77X1JMO8PjzJXFNntBLBKAeEQC_4-IGmRq22Szw/s640/4.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
6) Delete the file that is included in the error message.<br />
<br />
7) Finally, rerun the Configuration Wizard .<br />
<br />
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<div style="direction: ltr;">
<b>That's all...</b><br />
In this article we've seen Step by step <b>How to solve the error "File already exists" when configuring Microsoft Dynamics CRM for Outlook</b>.<br />
<b>Enjoy Microsoft Dynamics 365 CRM!</b></div>
</div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "open sans" , sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
</div>
</div>
<b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b><b><br /></b>Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-44435447444912881812018-07-18T22:49:00.000-07:002018-07-18T22:49:40.402-07:00Dynamics CRM Errors when importing unmanaged solutionIn this article we see <b>Step by step How to fix </b><b>Dynamics CRM Errors when importing unmanaged solution , in both CRM 2011 and CRM 2013</b><b> .</b><br />
Several errors can be thrown by Microsoft Dynamics CRM while importing an unmanaged solution from test to production environments, such as "This import has failed because a different entity with the identical name" , or "Field Is Not Unique"...<br />
<b>Usually the causes are differences of schema between fields or entities.</b><br />
<b><br /></b>
<u><b>First of all, try to check this 2 things</b></u>:<br />
<br />
<span style="color: red;">1) <b><u>Schema name and name</u></b> : <b>have the fields/entities EXACTLY (letter capitalization) the same schema names?</b> ( new_MyField < > new_myfield ) </span><br />
<span style="color: red;"><br /></span>
<span style="color: red;">2) <u><b>Schema data types</b>:</u> <b>have the fields/entities EXACTLY the same type?</b> (nvarchar = nvarchar, int = int)</span><br />
<span style="color: red;"><br /></span>
We'll see here in only 10 minutes how to perform a search for the DYNAMICS CRM API web service error codes , such as "<b>0x80044150</b>" or "<b>0x80041a06</b>" , for example :<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd_cuKDvigfQ6RGFt3k2g4_3alY3BPqWkYBXf8TY_tjMGPNxa8Ger7DAYaMEa_KLsWU_lD_of_8ZXVy2VQ_vOGqFLRdktYASMxt9DhgvX8B5I05rDjx5-ehvZvfqyY8Ic_6hb5IXyVb3U/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="Errors when importing unmanaged solution" border="0" height="456" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd_cuKDvigfQ6RGFt3k2g4_3alY3BPqWkYBXf8TY_tjMGPNxa8Ger7DAYaMEa_KLsWU_lD_of_8ZXVy2VQ_vOGqFLRdktYASMxt9DhgvX8B5I05rDjx5-ehvZvfqyY8Ic_6hb5IXyVb3U/s640/4.png" width="570" /></a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4j6ApiK7faLBkugmO39MuEbj6PcUthNrZ9R48F7Q4-05ATGIWo-FLoE9jb2iIszGqpy2k0mygNwIBNcDreHhs6GyIvfhEOsgwmAHXCYDuMyMz0PN3Yabb7NCxr0prXmWrBxo3TJ21UY/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Dynamics CRM Errors importing unmanaged solution" border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4j6ApiK7faLBkugmO39MuEbj6PcUthNrZ9R48F7Q4-05ATGIWo-FLoE9jb2iIszGqpy2k0mygNwIBNcDreHhs6GyIvfhEOsgwmAHXCYDuMyMz0PN3Yabb7NCxr0prXmWrBxo3TJ21UY/s640/3.png" width="570" /></a></div>
<br />
<br />
<h3 style="text-align: center;">
<b>How to </b>fix Dynamics CRM Errors when importing unmanaged solution</h3>
<br />
Usually, you will get this kind of error while importing a CRM solution:<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOeOekNROPw1WDFv0wC_pGRIls8o5yxHT1tSgb-UUUQjQbG1nm-ZkR7FJDrMOXDtEGY_WFE7U3Qw7Fx0ZpsYEtCFgEbn34fr5DqDg0iURkY3C7LrlB84iXjG9LgrZnUTDXEXda7kFMn4Y/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="Dynamics CRM Errors when importing unmanaged solution" border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOeOekNROPw1WDFv0wC_pGRIls8o5yxHT1tSgb-UUUQjQbG1nm-ZkR7FJDrMOXDtEGY_WFE7U3Qw7Fx0ZpsYEtCFgEbn34fr5DqDg0iURkY3C7LrlB84iXjG9LgrZnUTDXEXda7kFMn4Y/s640/5.png" width="540" /></a><br />
<br />
<br />
The steps are usually as following:<br />
0) open the importing error file and make a search for "0x" to get the error!!!<br />
1) get the hexadecimal error code for the Entity and <b>delete the hexadecimal prefix "0x"</b><br />
2) search the web for the error <b>without the "0x" prefix</b><br />
3) re-build any custom Field which has an <b>schema name</b> ("new_myfield") difference<br />
4) re-build any custom Field which has a <b>type</b> difference<br />
<br />
<br />
<h3>
1) Step #0: open the log file to find the error :</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4j6ApiK7faLBkugmO39MuEbj6PcUthNrZ9R48F7Q4-05ATGIWo-FLoE9jb2iIszGqpy2k0mygNwIBNcDreHhs6GyIvfhEOsgwmAHXCYDuMyMz0PN3Yabb7NCxr0prXmWrBxo3TJ21UY/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Dynamics CRM Errors when importing unmanaged solution" border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4j6ApiK7faLBkugmO39MuEbj6PcUthNrZ9R48F7Q4-05ATGIWo-FLoE9jb2iIszGqpy2k0mygNwIBNcDreHhs6GyIvfhEOsgwmAHXCYDuMyMz0PN3Yabb7NCxr0prXmWrBxo3TJ21UY/s640/3.png" width="540" /></a></div>
<br />
<br />
<br />
<h3>
2) Step #1: get the hexadecimal Error Code & delete its "0x" prefix :</h3>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTcnkYH24X4N-STszD7qSuAnSv5yahMwFCArAXDUtldydsooPBNgTMbRrIT0oYOWpayrzohQ5ysDHfRHn2BWG6Gs908eEPcqc7f-vHxJmsJGksglLxtZf8WUlvGC7ZIMOEMHLorc9Hn68/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Dynamics CRM when importing unmanaged solution" border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTcnkYH24X4N-STszD7qSuAnSv5yahMwFCArAXDUtldydsooPBNgTMbRrIT0oYOWpayrzohQ5ysDHfRHn2BWG6Gs908eEPcqc7f-vHxJmsJGksglLxtZf8WUlvGC7ZIMOEMHLorc9Hn68/s640/2.png" width="540" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<h3>
3) Step #2: search the Web for the code <u>but without the prefix "0X"</u>:</h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Make a search for "DYNAMICS CRM API web service error codes" , and append the error code:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0_UUqqSCU2vYghuAbsizqwgvFl59QtxPGDpCyDUV_amhjSmShsvUbSog3itNQKB4oUKLDf3CB3xn5c6jI0WggRvAAejGYSU-FwBsA9umol3gse-ytyP2imK1OqhFVZYxqhyLktrg5Pg/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM Errors when importing solution" border="0" height="440" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0_UUqqSCU2vYghuAbsizqwgvFl59QtxPGDpCyDUV_amhjSmShsvUbSog3itNQKB4oUKLDf3CB3xn5c6jI0WggRvAAejGYSU-FwBsA9umol3gse-ytyP2imK1OqhFVZYxqhyLktrg5Pg/s640/1.png" width="540" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPPE-nx_WvcMw1P3Y56UeKklxTvcfKBluJQzKuPwzEWm2b8ctqEQs5-hwhCg57o-Y6TZtdFxtMKg9X7-PAAIgD6nLyrF8fY6dxAvZs-j2-Y7NXSern5aGU0RybLP4V47jsN8MgmLdEke8/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Dynamics CRM Errors when importing unmanaged" border="0" height="578" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPPE-nx_WvcMw1P3Y56UeKklxTvcfKBluJQzKuPwzEWm2b8ctqEQs5-hwhCg57o-Y6TZtdFxtMKg9X7-PAAIgD6nLyrF8fY6dxAvZs-j2-Y7NXSern5aGU0RybLP4V47jsN8MgmLdEke8/s640/6.png" width="540" /></a></div>
<br />
<b>Remember</b>: as long as Microsoft Dynamics CRM uses GUIDs , and they are different between a development environment to a production environment, the only way it has to identify an Entity is its <b>schema name and its type</b> !!!!!!<br />
<br />
<br />
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<b>Happy CRM.....</b><br />
<b><br /></b><b> </b>by Carmel Schvartzman<br />
<b><br /></b>
<br />
<div style="direction: rtl;">
<b><span style="font-size: x-small;">כתב: כרמל שוורצמן</span></b><br />
<div>
<b><span style="font-size: x-small;"><br /></span></b></div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com1tag:blogger.com,1999:blog-7170990797045135567.post-32613578760977273832018-06-09T23:18:00.000-07:002018-06-09T23:18:10.595-07:00CRM RetrieveMultiple QueryExpression to retrieve the top one last created recordIn this article we see <b>Step by step </b><b>How to write a C# query Microsoft Dynamics CRM QueryExpression to retrieve the top one last created record/modified record , in both CRM 2011</b><b> , CRM 2013</b><b> ,CRM 2015 and Microsoft Dynamics 365</b><b> .</b><br />
We'll use the IOrganizationService RetrieveMultiple method with a FilterExpression and a ConditionExpression, to get only one record: the latest one created . We also check an attribute for null values .<br />
Usually this C# code will be run from a Dynamics CRM Plugin.<br />
<b>Download the C# code from the following GitHub repository:</b><br />
<br />
<b><br /></b>We'll see here in only 10 minutes how to write the CRM query , which will be shown this way , for example :<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzgQP7_tNIdsusgy-dhnyXajnyt4petviYcGTc6ZeMtb0eGeNTaBFXBSVhfd0w9DRap5XJRc8GNR44kMum9Sdzst5YExp0Eru9rZLtxNerE2-0dF2ThC0FWve0rHxBTIV2O8ol5FmEI2k/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM RetrieveMultiple QueryExpression to retrieve the top one last created record" border="0" height="234" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzgQP7_tNIdsusgy-dhnyXajnyt4petviYcGTc6ZeMtb0eGeNTaBFXBSVhfd0w9DRap5XJRc8GNR44kMum9Sdzst5YExp0Eru9rZLtxNerE2-0dF2ThC0FWve0rHxBTIV2O8ol5FmEI2k/s640/5.png" width="570" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<h3 style="text-align: center;">
CRM RetrieveMultiple QueryExpression to retrieve the top one last created record/last modified record</h3>
<br />
First , you need to set which columns to retrieve. It is strongly recommended that you do not select all columns in an of the Microsoft Dynamics CRM SDK entity :<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEDrgEh5Q4ywgV2HdbOE8g1Mtc3rkXMWo2cq3kaTKHfBsG6Rh0HBLkM46jvwotFETIc98SZfSKPTSv9iI0c-84nohfCoHhucvS-VChk5BLNRB-iGMmGRiQLaYjFprgs6GRIWs6NBARKxA/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM RetrieveMultiple QueryExpression to retrieve the top one last created record" border="0" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEDrgEh5Q4ywgV2HdbOE8g1Mtc3rkXMWo2cq3kaTKHfBsG6Rh0HBLkM46jvwotFETIc98SZfSKPTSv9iI0c-84nohfCoHhucvS-VChk5BLNRB-iGMmGRiQLaYjFprgs6GRIWs6NBARKxA/s640/1.png" width="570" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Next, we create the QueryExpression that will hold the query to be send to the OrganizationService , as follows :</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo7RpeTyPHbNGeSRcIihG_eqRyTGcCJJGkH2TissmgkCrY9QK7_ST9HncDbCmB7SGWlxxceMlDtRXfXXT_OQbZP9M_a7OfaxDvMPTyro8D1Oc-QliXETgUpHIKgScKoSlaovQgcrTjShU/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM RetrieveMultiple QueryExpression to retrieve the top one last created record" border="0" height="134" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo7RpeTyPHbNGeSRcIihG_eqRyTGcCJJGkH2TissmgkCrY9QK7_ST9HncDbCmB7SGWlxxceMlDtRXfXXT_OQbZP9M_a7OfaxDvMPTyro8D1Oc-QliXETgUpHIKgScKoSlaovQgcrTjShU/s640/2.png" width="570" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
There, we add an OrderExpression to sort the records acording to its "createdon" or "modifiedon" attribute.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Then, we cut the results to just the first result and circumscribe them to the first page:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi17VFVD0oXpGB65OUixG6lQ52Pj88Olixhlwar2lNKCUQhcDU9-QgvG-BbEEe3IoatXnNTiXUyc2akuqzAA-ncXpdcB49HOlgpU8zEoLF-7e2YEAzriqPwvrvooNI0GkeW_KYSAlyPaTY/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM RetrieveMultiple QueryExpression to retrieve the top one last created record" border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi17VFVD0oXpGB65OUixG6lQ52Pj88Olixhlwar2lNKCUQhcDU9-QgvG-BbEEe3IoatXnNTiXUyc2akuqzAA-ncXpdcB49HOlgpU8zEoLF-7e2YEAzriqPwvrvooNI0GkeW_KYSAlyPaTY/s640/3.png" width="570" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
Then, we can check some determined attribute to contain a value - with the not null ConditionOperator:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkaXXepKHUHK2vaFYAJmD_-wJlUAlP1YIeSf1gF79M47x5Wtgeoiwy3kclZ9l-pZUYGaVHnlZgoHB5kHfwyny0Dk3kitJjO27CRVLXhKnD1oY72rnVzbooHmMRrDsxjfsBgYTHm5wo8h4/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM RetrieveMultiple QueryExpression to retrieve the top one last created record" border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkaXXepKHUHK2vaFYAJmD_-wJlUAlP1YIeSf1gF79M47x5Wtgeoiwy3kclZ9l-pZUYGaVHnlZgoHB5kHfwyny0Dk3kitJjO27CRVLXhKnD1oY72rnVzbooHmMRrDsxjfsBgYTHm5wo8h4/s640/4.png" width="570" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
And include all conditions in a FilterExpression, into the Criteria:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzgQP7_tNIdsusgy-dhnyXajnyt4petviYcGTc6ZeMtb0eGeNTaBFXBSVhfd0w9DRap5XJRc8GNR44kMum9Sdzst5YExp0Eru9rZLtxNerE2-0dF2ThC0FWve0rHxBTIV2O8ol5FmEI2k/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM RetrieveMultiple QueryExpression to retrieve the top one last created record" border="0" height="234" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzgQP7_tNIdsusgy-dhnyXajnyt4petviYcGTc6ZeMtb0eGeNTaBFXBSVhfd0w9DRap5XJRc8GNR44kMum9Sdzst5YExp0Eru9rZLtxNerE2-0dF2ThC0FWve0rHxBTIV2O8ol5FmEI2k/s640/5.png" width="570" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both;">
The complete query will look something like this (this code has been tested , and works very well) :</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh738qb5pbRLhUllioSjm8AvKOBB6A1KPgRs2Kte4689BBHE-6dcBGq5K7j1tgmgbg1vEwpgTKCdHR5SI9BpWJSMGt5nz-t3VaZPfiNhUSYs0o_4ZQ5rjd-Kxhix_lWbQUnf80PgMz7Qos/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM RetrieveMultiple QueryExpression to retrieve the top one last created record" border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh738qb5pbRLhUllioSjm8AvKOBB6A1KPgRs2Kte4689BBHE-6dcBGq5K7j1tgmgbg1vEwpgTKCdHR5SI9BpWJSMGt5nz-t3VaZPfiNhUSYs0o_4ZQ5rjd-Kxhix_lWbQUnf80PgMz7Qos/s640/6.png" width="570" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
The steps are as follows:<br />
0) Set which columns to retrieve.<br />
1) Create the QueryExpression<br />
2) Add an OrderExpression<br />
3) Check some determined attribute to contain a value using a ConditionOperator (optional)<br />
4) Include all conditions inside the Criteria as a FilterExpression<br />
5) Send a RetrieveMultiple with the QueryExpression<br />
<div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<b>Happy CRM.....</b><br />
<b><br /></b><b> </b>by Carmel Schvartzman<br />
<b><br /></b>
<br />
<div style="direction: rtl;">
<b><span style="font-size: x-small;">כתב: כרמל שוורצמן</span></b><br />
<div>
<b><span style="font-size: x-small;"><br /></span></b></div>
<div>
</div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com1tag:blogger.com,1999:blog-7170990797045135567.post-8699261670180895982016-01-05T10:49:00.000-08:002016-01-05T10:49:11.112-08:00How to Fix the Dynamics CRM ERROR Public assembly must have public key tokenIn this article we see <b>Step by step </b><b>How to Fix the Dynamics CRM ERROR Public assembly must have public key token , in both CRM 2011</b><b> and CRM 2013</b><b> and CRM 2015</b><b> .</b><br />
Several errors can be thrown by Microsoft Dynamics CRM while registering a custom plugin at the CRM server.<br />
<b>Usually the error message will express "</b><b>Public assembly must have public key token"</b><b>.</b><br />
<b><br /></b>
We'll see here in only 10 minutes how to fix this error , which is shown this way , for example :<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkgs8yd5gPw40fD680foA2Vq5sOqnoI6ZWAajiOO7GoScWjtj3ABB1sM2lIIfLvFq-PqVOr6emF56BadcQM3s5RaNDsJb-McDMNSSvh2-s6T0N2DSwYOP_5ju8wEQyV44b0GtaroZfRIk/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="Public assembly must have public key token" border="0" height="330" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkgs8yd5gPw40fD680foA2Vq5sOqnoI6ZWAajiOO7GoScWjtj3ABB1sM2lIIfLvFq-PqVOr6emF56BadcQM3s5RaNDsJb-McDMNSSvh2-s6T0N2DSwYOP_5ju8wEQyV44b0GtaroZfRIk/s640/5.png" width="570" /></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbQhqs4V9Y8orUJ6T8yRAAqd0YkPr49Xht5t06hBwm3rrv2k4EBP1JS2NWtXMI6_Nd3TM4xvcOwDeqV6diq9xZGmbF0xCTCgLjR1tX-RZSDROJIgd1gb0eyset2mek27Tcznjqvbj5WA8/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Public assembly must have public key token" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbQhqs4V9Y8orUJ6T8yRAAqd0YkPr49Xht5t06hBwm3rrv2k4EBP1JS2NWtXMI6_Nd3TM4xvcOwDeqV6diq9xZGmbF0xCTCgLjR1tX-RZSDROJIgd1gb0eyset2mek27Tcznjqvbj5WA8/s640/6.png" width="570" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<h3 style="text-align: center;">
How to Fix the Dynamics CRM ERROR Public assembly must have public key token</h3>
<br />
Usually, you will get this kind of error while registering a new custom plugin using the Plugin Registration Tool of the Microsoft Dynamics CRM SDK:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZlGACA0MfRw6JYc16fm6_Dgw8R0jADVWv1vajRIaXPqyIFp0PztTlyOQKqFbTo8cT4Mc8tCxdsk8KgMnXnvNjLq1v8uR6RDUeKFCybHlMIGdFxYN4QtvxW4LDKivfE4s_qYs8SbMares/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Public assembly must have public key token" border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZlGACA0MfRw6JYc16fm6_Dgw8R0jADVWv1vajRIaXPqyIFp0PztTlyOQKqFbTo8cT4Mc8tCxdsk8KgMnXnvNjLq1v8uR6RDUeKFCybHlMIGdFxYN4QtvxW4LDKivfE4s_qYs8SbMares/s640/1.png" width="570" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
TO FIX THIS ERROR, reopen your Visual Studio project , and open the Properties window at the "Signing" tab , as follows :</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAHaoVSSHIAQbw1pDoYlIKPrNn6Dz18QNLh1aZujClfvf8Kjj24bL-h0PHw829l2odmTcBjexVj_o2d-kBoYl7vUBAt_5DAZSNjj1rBr7WPP0bCXb3fOkO7A6fMOXOOjetePjx6zpJyrU/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="Public assembly must have public key token" border="0" height="392" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAHaoVSSHIAQbw1pDoYlIKPrNn6Dz18QNLh1aZujClfvf8Kjj24bL-h0PHw829l2odmTcBjexVj_o2d-kBoYl7vUBAt_5DAZSNjj1rBr7WPP0bCXb3fOkO7A6fMOXOOjetePjx6zpJyrU/s640/7.png" width="570" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
There, check the "Sign the assembly" option.</div>
<div class="separator" style="clear: both; text-align: left;">
Optionally, you can sign the assembly using a password.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then, REBUILD your project, and go to the BIN folder to get the assembly.</div>
<div class="separator" style="clear: both; text-align: left;">
Open the Plugin Registration Tool, and specify the location of the assembly:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGbGFtqqyfj3HsHlYQNsCDjXMTYFK8ZnikBAs9AoDt-eFlvhL6NkV0laVI4gi5GkiouE2wqrCcKAMLV3WAgYImtPrmNYDX_Sci0jPJl699-zS3QYlCkouMgkOeuwRCYjlZhW6YuEMo6UY/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Public assembly must have public key token" border="0" height="396" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGbGFtqqyfj3HsHlYQNsCDjXMTYFK8ZnikBAs9AoDt-eFlvhL6NkV0laVI4gi5GkiouE2wqrCcKAMLV3WAgYImtPrmNYDX_Sci0jPJl699-zS3QYlCkouMgkOeuwRCYjlZhW6YuEMo6UY/s640/2.png" width="570" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then, set the isolation to "None", sot that there will be no limitations to the plugin functionality.</div>
<div class="separator" style="clear: both; text-align: left;">
Also , select the database option as the place to store the assembly:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitIoyexQetW-fuMv-7usiZ6PL9V4fVyFhA9e2oR_BbzKoK7vpcLOWMRdVu-5-hqXnKEce-zcyPTnAzucJlHgG0yY-b73L6hkeA9pGHMoKnLEvlhWh4ygrG2xDEb2oloJgK2qtWhkPnXtA/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Public assembly must have public key token" border="0" height="434" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitIoyexQetW-fuMv-7usiZ6PL9V4fVyFhA9e2oR_BbzKoK7vpcLOWMRdVu-5-hqXnKEce-zcyPTnAzucJlHgG0yY-b73L6hkeA9pGHMoKnLEvlhWh4ygrG2xDEb2oloJgK2qtWhkPnXtA/s640/3.png" width="570" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And click on the "Register Selected Plugins" button:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixOaiqqTFHXqsoQI42SMRA3RTWieGmEFhSlKiHG4QaCSuZ9dA5RGhqbcRn5u9yn-ck3DUeIhie0DpQWnqr9XAlqfXeBHSgPZ5SQVRchYqemttBR1wM4TbTP5iW0DUlWL2syaC9UM8KBRU/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Public assembly must have public key token" border="0" height="496" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixOaiqqTFHXqsoQI42SMRA3RTWieGmEFhSlKiHG4QaCSuZ9dA5RGhqbcRn5u9yn-ck3DUeIhie0DpQWnqr9XAlqfXeBHSgPZ5SQVRchYqemttBR1wM4TbTP5iW0DUlWL2syaC9UM8KBRU/s640/4.png" width="570" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
This time, because the plugin includes a signature, CRM will accept the registration:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7yrCFh3VeMyjfEOWcQx5UPZ0KPSpT8ogOxtWCp0rNJsC95iJRqUYWUUBiS4aEv8A_PVSV7_oBhUj0uDDbyz0BVXSxDMTLmOv3Xr42fOpM3wyj1WyldcYYkEz0DrJhTGBs3eU02tNxhhg/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Public assembly must have public key token" border="0" height="448" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7yrCFh3VeMyjfEOWcQx5UPZ0KPSpT8ogOxtWCp0rNJsC95iJRqUYWUUBiS4aEv8A_PVSV7_oBhUj0uDDbyz0BVXSxDMTLmOv3Xr42fOpM3wyj1WyldcYYkEz0DrJhTGBs3eU02tNxhhg/s640/8.png" width="570" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
The steps are usually as following:<br />
0) reopen your Visual Studio project<br />
1) open the Properties window at the "Signing" tab<br />
2) check the "Sign the assembly" option<br />
3) sign the assembly using a password (optional)<br />
4) REBUILD your project<br />
5) go to the BIN folder to get the assembly<br />
<div class="separator" style="clear: both;">
6) Open the Plugin Registration Tool</div>
<div class="separator" style="clear: both;">
7) specify the location of the assembly</div>
<div class="separator" style="clear: both;">
8) click on the "Register Selected Plugins" button</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<b>Happy CRM.....</b><br />
<b><br /></b><b> </b>by Carmel Schvartzman<br />
<b><br /></b>
<br />
<div style="direction: rtl;">
<b><span style="font-size: x-small;">כתב: כרמל שוורצמן</span></b><br />
<div>
<b><span style="font-size: x-small;"><br /></span></b></div>
<div>
</div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com8tag:blogger.com,1999:blog-7170990797045135567.post-8836034150014432112015-09-10T22:32:00.000-07:002015-09-10T22:32:12.956-07:00Install CRM 2013 Developer Tools in your Visual Studio 2012In this article we describe <b>Step by step </b><b>How to Install CRM 2013 Developer Tools in your Visual Studio 2012 in 5 minutes.</b><br />
The <b>CRM 2013 Developer Toolkit</b> , once installed inside the Visual Studio 2012, will allow you to easily create CRM Plugins , Dialogs and Workflows , accessing to CRM Entities and strongly typed proxy classes, and even create, edit and deploy CRM Web Resources, everything from your code!!! The CRM 2013 Developer Toolkit will allow you to easily deploy your code on CRM web servers :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyKYALeSNSstKqYDf5PcAJHCx4YovVZKItfQPjxi1s56JhQrgqSKOlamw0UhgiOHaj5RHA5P4XywMZMLYEWXsaz1QQL12Lp8u3eeeYX9SBp7V3EZuuFVqFwyhli936llNxWar5ifytXYM/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Install CRM 2013 Developer Tools in your Visual Studio 2012" border="0" height="420" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyKYALeSNSstKqYDf5PcAJHCx4YovVZKItfQPjxi1s56JhQrgqSKOlamw0UhgiOHaj5RHA5P4XywMZMLYEWXsaz1QQL12Lp8u3eeeYX9SBp7V3EZuuFVqFwyhli936llNxWar5ifytXYM/s640/1.png" width="560" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="text-align: center;">
How to Install CRM 2013 Developer Tools in your Visual Studio 2012</h3>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<b>Phase 1:</b> Check for required prerequisites before installing the Developers Toolkit:<br />
<br />
Go to the <a href="https://msdn.microsoft.com/en-us/library/hh547459(v=crm.6).aspx" target="_blank">Install or uninstall the Developer Toolkit</a> to check for prerequisites, and to the <a href="https://msdn.microsoft.com/en-us/library/hh372957(v=crm.6).aspx" target="_blank">Developer Toolkit for Microsoft Dynamics CRM</a> web page to see the details of the Developers Tools:<br />
<div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpAck1op-NEHuwn0f084TS3BQlDjyqKguq8Bk833BmD50em5iEbrxYF9uEmEJghg0yu_XuADXTq1SrHmRSZmVMdT07WJXcol7f0EwJOPIH2i6pUg3Jc1vEQWWfBrCk0pzw7eOCLPGI5Ug/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Install CRM 2013 Developer Tools in your Visual Studio 2012 1" border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpAck1op-NEHuwn0f084TS3BQlDjyqKguq8Bk833BmD50em5iEbrxYF9uEmEJghg0yu_XuADXTq1SrHmRSZmVMdT07WJXcol7f0EwJOPIH2i6pUg3Jc1vEQWWfBrCk0pzw7eOCLPGI5Ug/s640/3.png" width="560" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Browse to the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=40321" target="_blank">Microsoft Download Center</a> and locate the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=40321" target="_blank">CRM 2013 Developer Toolkit download page</a>:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgho1LWxHndMAStDd4iJ3h_M2Sj5yuTlEVvR2zPxUFQ8Wvqb-HR4L3rh9_qZBdC_1uk8aypO0whBYLDiqbQYpEFdNwdOdF0lYAy89nWuqZOr5OWUc00hy9bnLEClFNjCLuZk0nO7VZgPn4/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Install CRM 2013 Developer Tools in your Visual Studio 2012 2" border="0" height="374" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgho1LWxHndMAStDd4iJ3h_M2Sj5yuTlEVvR2zPxUFQ8Wvqb-HR4L3rh9_qZBdC_1uk8aypO0whBYLDiqbQYpEFdNwdOdF0lYAy89nWuqZOr5OWUc00hy9bnLEClFNjCLuZk0nO7VZgPn4/s640/4.png" width="560" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<b>Phase 2:</b> Download the Toolkit and open the ZIP file:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Click on the installer and follow the CRM 2013 Developer Tools for Visual Studio 2012 setup instructions:</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6TWVbd0iTSLDse1g6FSMv6BVP24anuvGZS87TgeoWOV18o_sDej3QZHlK28xtKELO83pIeR02SE_6uI5rfsQ0crHqH3uEYupR7vwZaLj596iyuU_gZy1eoSSr0uAhqKw2bp1kBEAsZkk/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Install CRM 2013 Developer Tools in your Visual Studio 2012 3" border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6TWVbd0iTSLDse1g6FSMv6BVP24anuvGZS87TgeoWOV18o_sDej3QZHlK28xtKELO83pIeR02SE_6uI5rfsQ0crHqH3uEYupR7vwZaLj596iyuU_gZy1eoSSr0uAhqKw2bp1kBEAsZkk/s400/2.png" width="400" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
<b>Phase 3: Finish the CRM 2013 Developer Tools in your Visual Studio 2012 </b> <b>Setup :</b></div>
<div class="separator" style="clear: both;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After you finish the CRM 2013 Developer Toolkit for Visual Studio 2012 installation , save your projects, close Visual Studio 2012, and reopen it, to see the changes:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyKYALeSNSstKqYDf5PcAJHCx4YovVZKItfQPjxi1s56JhQrgqSKOlamw0UhgiOHaj5RHA5P4XywMZMLYEWXsaz1QQL12Lp8u3eeeYX9SBp7V3EZuuFVqFwyhli936llNxWar5ifytXYM/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Install CRM 2013 Developer Tools in your Visual Studio 2012 4" border="0" height="420" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyKYALeSNSstKqYDf5PcAJHCx4YovVZKItfQPjxi1s56JhQrgqSKOlamw0UhgiOHaj5RHA5P4XywMZMLYEWXsaz1QQL12Lp8u3eeeYX9SBp7V3EZuuFVqFwyhli936llNxWar5ifytXYM/s640/1.png" width="560" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
As you can see, now there are Templates for you to use when creating a new CRM 2013 Plugin or Workflow.</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<b>That's all...Enjoy Dynamics CRM</b></div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: 'Open Sans', sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
<br /></div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com2tag:blogger.com,1999:blog-7170990797045135567.post-69202587984987112862015-08-14T04:47:00.000-07:002015-08-14T04:47:59.335-07:00How to Check Error Codes in Dynamics CRM API Web ServiceIn this article we see <b>Step by step How to Check Error Codes in </b><b><span style="font-family: "Tahoma",sans-serif; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-language: HE; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;">Dynamics CRM API Web
Service </span></b><b> .</b><br />
We'll review here in only 5 minutes how to search for the DYNAMICS CRM API web service error codes , such as "<b>0x80041a06</b>" , for example :<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4j6ApiK7faLBkugmO39MuEbj6PcUthNrZ9R48F7Q4-05ATGIWo-FLoE9jb2iIszGqpy2k0mygNwIBNcDreHhs6GyIvfhEOsgwmAHXCYDuMyMz0PN3Yabb7NCxr0prXmWrBxo3TJ21UY/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to Check Error Codes in Dynamics CRM API Web Service" border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4j6ApiK7faLBkugmO39MuEbj6PcUthNrZ9R48F7Q4-05ATGIWo-FLoE9jb2iIszGqpy2k0mygNwIBNcDreHhs6GyIvfhEOsgwmAHXCYDuMyMz0PN3Yabb7NCxr0prXmWrBxo3TJ21UY/s640/3.png" width="570" /></a></div>
<br />
<br />
<h3 style="text-align: center;">
<b>How to Check Error Codes in </b><b><span style="font-family: Tahoma, sans-serif; font-size: 11pt;">Dynamics CRM API Web Service</span></b></h3>
<br />
The steps are as following:<br />
1) open the error file and find the corresponding XML element for the Entity<br />
2) get the hexadecimal error code for the Entity and <b>get rid of the hexadecimal prefix "0x"</b><br />
3) search the web for the error <b>without the "0x" prefix</b><br />
<br />
<br />
<h3>
1) Step #1: open the error file and find the XML element for the Entity :</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4j6ApiK7faLBkugmO39MuEbj6PcUthNrZ9R48F7Q4-05ATGIWo-FLoE9jb2iIszGqpy2k0mygNwIBNcDreHhs6GyIvfhEOsgwmAHXCYDuMyMz0PN3Yabb7NCxr0prXmWrBxo3TJ21UY/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Check Error Codes in Dynamics CRM API Web Service" border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4j6ApiK7faLBkugmO39MuEbj6PcUthNrZ9R48F7Q4-05ATGIWo-FLoE9jb2iIszGqpy2k0mygNwIBNcDreHhs6GyIvfhEOsgwmAHXCYDuMyMz0PN3Yabb7NCxr0prXmWrBxo3TJ21UY/s640/3.png" width="540" /></a></div>
<br />
<br />
<br />
<h3>
2) Step #2: get the hexadecimal Error Code without its "0x" prefix :</h3>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTcnkYH24X4N-STszD7qSuAnSv5yahMwFCArAXDUtldydsooPBNgTMbRrIT0oYOWpayrzohQ5ysDHfRHn2BWG6Gs908eEPcqc7f-vHxJmsJGksglLxtZf8WUlvGC7ZIMOEMHLorc9Hn68/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Error Codes in Dynamics CRM API Web Service" border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTcnkYH24X4N-STszD7qSuAnSv5yahMwFCArAXDUtldydsooPBNgTMbRrIT0oYOWpayrzohQ5ysDHfRHn2BWG6Gs908eEPcqc7f-vHxJmsJGksglLxtZf8WUlvGC7ZIMOEMHLorc9Hn68/s640/2.png" width="540" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<h3>
3) Step #3: search the Web for the Error code without the prefix "0X":</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0_UUqqSCU2vYghuAbsizqwgvFl59QtxPGDpCyDUV_amhjSmShsvUbSog3itNQKB4oUKLDf3CB3xn5c6jI0WggRvAAejGYSU-FwBsA9umol3gse-ytyP2imK1OqhFVZYxqhyLktrg5Pg/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to Check Error Codes" border="0" height="440" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0_UUqqSCU2vYghuAbsizqwgvFl59QtxPGDpCyDUV_amhjSmShsvUbSog3itNQKB4oUKLDf3CB3xn5c6jI0WggRvAAejGYSU-FwBsA9umol3gse-ytyP2imK1OqhFVZYxqhyLktrg5Pg/s640/1.png" width="540" /></a></div>
<br />
<br />
<br />
<br />
That's all. <br />
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<b>Happy programming.....</b><br />
<b><br /></b><b> </b>by Carmel Schvartzman<br />
<b><br /></b>
<br />
<div style="direction: rtl;">
<b><span style="font-size: x-small;">כתב: כרמל שוורצמן</span></b><br />
<div>
<b><span style="font-size: x-small;"><br /></span></b></div>
</div>
<br /></div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-13534383938861294992015-07-05T12:08:00.000-07:002015-07-05T12:08:07.721-07:00How to Add a custom Button to a CRM 2013 Web FormIn this article we see <b>Step by step How to Add a custom Button to a CRM 2013 Web Form .</b><br />
We'll review here in only 5 minutes how to create an HTML5 Button at the client side Front End , using only javascript, HTML and CSS3:<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZwfLt9eRcjes8Nb-aeCag2aq9AlAFe6Cp9THn6S7az6iR-i1Ae3_CX43f_cZQkQ6kSX4mg1DOe_k5vyei4MN5jsMf1FjI5lKZ5gy7iw2CfeGG1FGMyJ0WdmYaIh_W93wHnD-EFUOp01Y/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="93" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZwfLt9eRcjes8Nb-aeCag2aq9AlAFe6Cp9THn6S7az6iR-i1Ae3_CX43f_cZQkQ6kSX4mg1DOe_k5vyei4MN5jsMf1FjI5lKZ5gy7iw2CfeGG1FGMyJ0WdmYaIh_W93wHnD-EFUOp01Y/s400/2.png" width="400" /></a><br />
<br />
<br />
The steps are as following:<br />
1) create a CRM field to be the container of the button(set its text as ".")<br />
2) create a web resource containing the following javascript<br />
3) call the web resource from your CRM form, sending as argument the name of your container field.<br />
<br />
<br />
<h3>
1) Step #1: create a CRM field to be the container of the button:</h3>
<br />
The button will be located at the CRM field (called "<span style="color: #0b5394; font-size: x-small;"><b>sFieldName" </b></span>in the following code).<br />
Try to create a new CRM field to parent the button, and set "." as its text. This way the button will fill the field, and you can locate it wherever you want inside the CRM form.<br />
<br />
<h3>
2) Step #2: create a web resource containing the following javascript:</h3>
This is the code that creates the Button:<br />
It just retrieves the HTML5 element wrapping the CRM field where you want the button appended to, and creates an element with a custom button:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5xzWM7XKPKG_W3pqyUUfHoHockamSlKb9GfuAJ5VPybvVO8ID7x7cKk5FD4qNzXs1FCg_t41CnlL8n3xoBdxN-VVMDoXqVXPrdhDoEZvEoGaIeG0PTmVNOe6E9J1tuMxGWjc6YtifxWY/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5xzWM7XKPKG_W3pqyUUfHoHockamSlKb9GfuAJ5VPybvVO8ID7x7cKk5FD4qNzXs1FCg_t41CnlL8n3xoBdxN-VVMDoXqVXPrdhDoEZvEoGaIeG0PTmVNOe6E9J1tuMxGWjc6YtifxWY/s640/1.png" width="622" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
Create a Web Resource with the following javascript code (note: this code does not depend on jQuery or any other framework: you can copy-paste it as it is):<br />
<br />
<b><span style="color: #0b5394; font-size: x-small;">function fnXRMClientButton(sFieldName)</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;">{ // sFieldName : "new_somefield"</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> </span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> if (document.getElementById(sFieldName) != null) {</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> sFieldName = "field" + sFieldName;</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> if (document.getElementById(sFieldName) == null)</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> {</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> var oParentElement = document.getElementById(sFieldName + "_d");</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> oContainerElement = document.createElement("oContainerElement");</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> oParentElement.appendChild(oContainerElement, oParentElement);</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> </span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> var btn = document.createElement("button");</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> var txt = document.createElement("span");</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> txt.innerText = "BUTTON TEXT"; </span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.id = "btnCallAction";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.appendChild(txt);</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.margin = "10px";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.padding = "5px";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.width = "300px";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.height = "50px";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.textAlign = "center";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.borderRadius = "5px";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.textShadow = "1px 1px 2px #FFF";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.color = "#000";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.boxShadow = "#a8a3a3 5px 5px 1px"; </span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.border = "1px double #dcdcdc"; </span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.background = "#f5f5f5";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.style.font = "600 14px Tahoma";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> oContainerElement.appendChild(btn);</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"><br /></span></b>
<b><span style="color: #0b5394; font-size: x-small;"><br /></span></b>
<b><span style="color: #0b5394; font-size: x-small;"> document.getElementById(sFieldName).style.width = "0%";</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> btn.onclick = function () {</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> OnClickActionFunction(oContainerElement);</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"><br /></span></b>
<b><span style="color: #0b5394; font-size: x-small;"> };</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"><br /></span></b>
<b><span style="color: #0b5394; font-size: x-small;"> }</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;"> }</span></b><br />
<b><span style="color: #0b5394; font-size: x-small;">}</span></b><br />
<div>
<br />
<br />
<h3>
3) Step #3: call the web resource from your CRM form, sending as argument the name of your container field:</h3>
<br />
<b><span style="color: #0b5394; font-size: x-small;">fnXRMClientButton(</span></b><b><span style="color: #0b5394; font-size: x-small;">"new_somefield"</span></b><b><span style="color: #0b5394; font-size: x-small;">)</span></b><br />
<br />
<br />
<div class="separator" style="clear: both;">
That's all. </div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<b>Happy programming.....</b><br />
<b><br /></b><b> </b>by Carmel Schvartzman<br />
<b><br /></b>
<br />
<div style="direction: rtl;">
<b><span style="font-size: x-small;">כתב: כרמל שוורצמן</span></b><br />
<div>
<b><span style="font-size: x-small;"><br /></span></b></div>
</div>
<br />
<br /></div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-88259848618545407252015-06-09T12:18:00.000-07:002015-06-09T12:18:09.108-07:00How to watch SSIS Variables values at debugging in Sql Server Integration ServicesIn this article we see <b>Step by step How to watch SSIS Variables values at debugging in Sql Server Integration Services .</b><br />
We'll review here in only 5 minutes how to check SSIS variables at runtime, telling apart those at Foreach Loops from those at Data Flows . We'll be using the following SSIS application:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXTBRIXUe33uX2qoYBdH7WlDtWm9aosAoPLj2GJ06mtvJvo_tkqr1LbdybdzHzcG_Mz7fXs9YqVIuwIUSk21xzmWgQxUkDIecuJMyvDe8-2XEtXAS6qxiK9U4U0Dp1XiZwJ9qNNNz8z8E/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to watch SSIS Variables values at debugging in Sql Server Integration Services" border="0" height="366" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXTBRIXUe33uX2qoYBdH7WlDtWm9aosAoPLj2GJ06mtvJvo_tkqr1LbdybdzHzcG_Mz7fXs9YqVIuwIUSk21xzmWgQxUkDIecuJMyvDe8-2XEtXAS6qxiK9U4U0Dp1XiZwJ9qNNNz8z8E/s1600/1.png" width="560" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="text-align: center;">
<b style="font-size: medium; text-align: start;">How to watch SSIS Variables values at debugging in Sql Server Integration Services</b></h3>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
In the picture below you can see the guiding principles of watching variables at runtime in a "Data Flow Task" :<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj89QzL4vc6rl0zhegnIebBEtWBj9TiBZ0km5jm1NaKvnToi_bL6dWwE4LZ0TTtxGM8ODyHXIJkHjRwfQ1pMqgv6DrqYO9yAmPgx2kXIrfyWREUYcehTytv7XSme-P2q2-goeyiy8Dvygc/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="watch SSIS Variables values at debugging in Sql Server Integration Services" border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj89QzL4vc6rl0zhegnIebBEtWBj9TiBZ0km5jm1NaKvnToi_bL6dWwE4LZ0TTtxGM8ODyHXIJkHjRwfQ1pMqgv6DrqYO9yAmPgx2kXIrfyWREUYcehTytv7XSme-P2q2-goeyiy8Dvygc/s1600/5.png" width="540" /></a></div>
<br />
<br />
To start, select the SSIS item in which you want to watch the variables values.<br />
Since variables have scopes, you should make sure that the current scope comprehend the chosen item.<br />
We'll start by setting a breakpoint in a Data Flow Task .<br />
Now that you decided which flow item to watch, click the "Edit Breakpoints" menu :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV6rV60QG9Y-ofK4U6_PJaQi8vfllj6ZANLhV6YWPwOwpLGcn-D3ff8Prcgdoen72NLYRZ_k8Hk_QMeeseb6AFGj8A3tKbqU1sXVQRuYIL5SVygAcA3f3TCBm6ZaCZB5iiwFQ2nME9Rck/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV6rV60QG9Y-ofK4U6_PJaQi8vfllj6ZANLhV6YWPwOwpLGcn-D3ff8Prcgdoen72NLYRZ_k8Hk_QMeeseb6AFGj8A3tKbqU1sXVQRuYIL5SVygAcA3f3TCBm6ZaCZB5iiwFQ2nME9Rck/s1600/4.png" width="540" /></a></div>
<br />
<div>
Now choose the Break condition where to stop the debug . Mostly it can be the OnPreExecute event, or any one of the several Events that you can see on the following picture:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7KHRwnst2wTXW7A7zVEIP4UrX6012nRUqcq6SAW9hRxc1wRYhEHES757iUCgoX6PG2J_fD7RwCLvWlIEpVOwnNyb201Z8lqStLpK8f4lWsI_C0tLi9PAx8HvsqLhlEqmBjAdlti6IGjE/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="SSIS Variables values at debugging in Sql Server Integration Services" border="0" height="444" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7KHRwnst2wTXW7A7zVEIP4UrX6012nRUqcq6SAW9hRxc1wRYhEHES757iUCgoX6PG2J_fD7RwCLvWlIEpVOwnNyb201Z8lqStLpK8f4lWsI_C0tLi9PAx8HvsqLhlEqmBjAdlti6IGjE/s1600/3.png" width="540" /></a></div>
<br />
However, in case of a Foreach Loop Container, it stands to reason that you will want to watch the variables at the start of every loop iteration . So select from the checklist the "Break at the beginning..." option:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjCghpKRMvYlVo0D4kK3Ysd5Ng6L6eXLNBt8uteJfeI-oEuh9Dhy9EM7Q_FdUSXF7AkE5_eGW4SEC2YM8kSMDxi4YgzuFloDf4JbjqCKa_yeP7-C9YEJ90fSnKNooA3MxLhm3Il1sD5fw/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="values at debugging in Sql Server Integration Services" border="0" height="514" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjCghpKRMvYlVo0D4kK3Ysd5Ng6L6eXLNBt8uteJfeI-oEuh9Dhy9EM7Q_FdUSXF7AkE5_eGW4SEC2YM8kSMDxi4YgzuFloDf4JbjqCKa_yeP7-C9YEJ90fSnKNooA3MxLhm3Il1sD5fw/s1600/2.png" width="540" /></a></div>
<br />
It can also be set in which cases to stop the runtime: it can be set to stop when the breakpoint has been reached certain times:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ5pTVd3qgKND5xV2Ic1kcupnLHMKl7khW7WfeM0AFsnkyfuAIgRr233cXH9duZMswRp3yDT1Lk1shwf2cajhoyT8QLRbkTylgyjAd-dV2eO7iEWm9R_ujA8RLWQqPqVbZzMZxjPAQzK4/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Variables values at debugging in Sql Server Integration Services" border="0" height="462" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ5pTVd3qgKND5xV2Ic1kcupnLHMKl7khW7WfeM0AFsnkyfuAIgRr233cXH9duZMswRp3yDT1Lk1shwf2cajhoyT8QLRbkTylgyjAd-dV2eO7iEWm9R_ujA8RLWQqPqVbZzMZxjPAQzK4/s1600/7.png" width="540" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
Once you finished setting the breakpoints, start the debug and, while the breakpoint has been reached, open the "Locals" window. There you will find all the current variables in scope:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXTBRIXUe33uX2qoYBdH7WlDtWm9aosAoPLj2GJ06mtvJvo_tkqr1LbdybdzHzcG_Mz7fXs9YqVIuwIUSk21xzmWgQxUkDIecuJMyvDe8-2XEtXAS6qxiK9U4U0Dp1XiZwJ9qNNNz8z8E/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="debugging in Sql Server Integration Services" border="0" height="366" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXTBRIXUe33uX2qoYBdH7WlDtWm9aosAoPLj2GJ06mtvJvo_tkqr1LbdybdzHzcG_Mz7fXs9YqVIuwIUSk21xzmWgQxUkDIecuJMyvDe8-2XEtXAS6qxiK9U4U0Dp1XiZwJ9qNNNz8z8E/s1600/1.png" width="540" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj89QzL4vc6rl0zhegnIebBEtWBj9TiBZ0km5jm1NaKvnToi_bL6dWwE4LZ0TTtxGM8ODyHXIJkHjRwfQ1pMqgv6DrqYO9yAmPgx2kXIrfyWREUYcehTytv7XSme-P2q2-goeyiy8Dvygc/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to watch SSIS Variables values at debugging" border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj89QzL4vc6rl0zhegnIebBEtWBj9TiBZ0km5jm1NaKvnToi_bL6dWwE4LZ0TTtxGM8ODyHXIJkHjRwfQ1pMqgv6DrqYO9yAmPgx2kXIrfyWREUYcehTytv7XSme-P2q2-goeyiy8Dvygc/s1600/5.png" width="540" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
That's all. </div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<b>Happy programming.....</b><br />
<b><br /></b><b> </b>by Carmel Schvartzman<br />
<b><br /></b>
<br />
<div style="direction: rtl;">
<b><span style="font-size: x-small;">כתב: כרמל שוורצמן</span></b><br />
<div>
<b><span style="font-size: x-small;"><br /></span></b>
<b><span style="font-size: x-small;"><br /></span></b><b><span style="font-size: x-small;"><br /></span></b><b><span style="font-size: x-small;"><br /></span></b></div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-33350902363932778902015-04-21T12:45:00.000-07:002015-04-21T12:45:54.172-07:00How to use Tracing in CRM 2011-2013 Plugins and WorkflowsIn this article we describe <b>Step by step </b><b>How to use Tracing in CRM 2011-2013 Plugins and Workflows in C# in 5 minutes.</b><br />
Since CRM Plugins and Workflows are deployed on web servers after the development reaches the release stage , it is usually very helpful to include tracing in your code in profusion, not only in error cases, at least when you are putting to the test new developments .<br />
CRM 2011-2013 allows you to include tracing galore:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHWJ10ANPaDqLwfeMh8LKYIguaLMNXBSfs7rz-qgJ4x64HuzI9HccrDrfM91fupkI8CoAPXZ8VBSRsj70JOjs31ZbgjU_9py24nyAmf6z6ov3mkfgQawiGZi6AtJloYXXcwQm1zBjZt_c/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to use Tracing in CRM 2011-2013 Plugins and Workflows " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHWJ10ANPaDqLwfeMh8LKYIguaLMNXBSfs7rz-qgJ4x64HuzI9HccrDrfM91fupkI8CoAPXZ8VBSRsj70JOjs31ZbgjU_9py24nyAmf6z6ov3mkfgQawiGZi6AtJloYXXcwQm1zBjZt_c/s1600/4.png" height="258" width="540" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="text-align: center;">
How to use Tracing in CRM 2011-2013 Plugins and Workflows</h3>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<b>Phase 1:</b> use the GetExtension() method from the "context" at your plugin-workflow:<br />
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHWJ10ANPaDqLwfeMh8LKYIguaLMNXBSfs7rz-qgJ4x64HuzI9HccrDrfM91fupkI8CoAPXZ8VBSRsj70JOjs31ZbgjU_9py24nyAmf6z6ov3mkfgQawiGZi6AtJloYXXcwQm1zBjZt_c/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Tracing in CRM 2011-2013 Plugins and Workflows " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHWJ10ANPaDqLwfeMh8LKYIguaLMNXBSfs7rz-qgJ4x64HuzI9HccrDrfM91fupkI8CoAPXZ8VBSRsj70JOjs31ZbgjU_9py24nyAmf6z6ov3mkfgQawiGZi6AtJloYXXcwQm1zBjZt_c/s1600/4.png" height="258" width="540" /></a></div>
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
Since this is a generic C# Dot.Net method, use the ITracingService interface to get the tracing service from the context.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<b>Phase 2:</b> Send the ITracingService to any method where you intend to log information using tracing:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEATHiN78FDuJetUdCypW3B3FzsGL0qblfnGP-8aUZaqzMmDRqDFqDuqEcI1q89IeI-XePqJ_iSWcubpfjwCtGc6P3sckycJZDbWpHPWdjNuj-SDTN5Ec_MNEIDXvdW1PuihmBOMtWpYw/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="CRM 2011-2013 Plugins and Workflows " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEATHiN78FDuJetUdCypW3B3FzsGL0qblfnGP-8aUZaqzMmDRqDFqDuqEcI1q89IeI-XePqJ_iSWcubpfjwCtGc6P3sckycJZDbWpHPWdjNuj-SDTN5Ec_MNEIDXvdW1PuihmBOMtWpYw/s1600/3.png" height="210" width="540" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
For example:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9OvT3XtE_ssT7RPhIHf5Wtptj2XRxe5oAzLSR0aHRHtW0tcxL0DFi0ax0boUmzOMlxmN9_q_X_taJ6w-JGbIapRyHoKGt5XgpAr0XW4UzC1GqbroBKi9xbuGbA_9ETPq1Xxa4meHCWHw/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to use Tracing in CRM " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9OvT3XtE_ssT7RPhIHf5Wtptj2XRxe5oAzLSR0aHRHtW0tcxL0DFi0ax0boUmzOMlxmN9_q_X_taJ6w-JGbIapRyHoKGt5XgpAr0XW4UzC1GqbroBKi9xbuGbA_9ETPq1Xxa4meHCWHw/s1600/2.png" height="322" width="540" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Phase 3: inside the plugin's methods, call the ITracingService's Trace() method to send messages to the tracing:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5sUtgkPIkXRjUkc_Zv-wI2OSoA81hQIjrItuj8ukTVGPMDcafkeRalDJQavOIOYjRpZEZvjwDdBxAGTFA799_H1h5f-AgvtCSzPPQGmwsdg_S_7sUjw5R2tnIsKeEUq1ab4-eFHP1z-4/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to use Tracing in CRM 2011-2013 " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5sUtgkPIkXRjUkc_Zv-wI2OSoA81hQIjrItuj8ukTVGPMDcafkeRalDJQavOIOYjRpZEZvjwDdBxAGTFA799_H1h5f-AgvtCSzPPQGmwsdg_S_7sUjw5R2tnIsKeEUq1ab4-eFHP1z-4/s1600/5.png" height="166" width="540" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
In case of error, CRM will display an alert showing the tracing:</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsCE8b9DCOCuGBTFXZbeg7vZ6mHhBm0nT-5CrukOojTl2QCQmmmupyyHDHmSEWT6WyoMJ_x5MG9DKBKbB8LaJ-M6CmlQDmd-5WuYz7ky6eBwVAnwgXX-ioCIvr0fTiKSOHA2-FQ8b9icA/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to use Tracing in CRM 2011-2013 Plugins and Workflows " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsCE8b9DCOCuGBTFXZbeg7vZ6mHhBm0nT-5CrukOojTl2QCQmmmupyyHDHmSEWT6WyoMJ_x5MG9DKBKbB8LaJ-M6CmlQDmd-5WuYz7ky6eBwVAnwgXX-ioCIvr0fTiKSOHA2-FQ8b9icA/s1600/1.png" height="358" width="540" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div style="direction: rtl;">
<div>
<b>That's all...Enjoy Dynamics CRM</b></div>
<div>
<br /></div>
<div>
by Carmel Schvartzman</div>
<div>
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: 'Open Sans', sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div>
<br /></div>
<br /></div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-92213993405225837792015-04-15T10:34:00.000-07:002015-04-15T10:34:53.203-07:00How to programmatically create a CustomerAddress in Dynamics CRM 2011/2013<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<ol>
<li>In this article we see <b>how to programmatically create a CustomerAddress in Dynamics CRM 2011/2013. </b><br />In CRM 2013, the address data of an Account or a Contact are stored in a separate Entity called CustomerAddress, on a 1:N relationship basis, in which an Account can have (and have, by default) many addresses. <br />This post is about Dynamics CRM 2011 - 2013 custom Plugins or custom Workflows, and any C# code which calls the CRM Organization Web Service to create a new CustomerAddress item , that means, a third address for an Account or a Contact. The following snapshot shows the Account address fields:<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSE2thbXvM2QuAUPKKWBJCy5qEgXQJ8amG8UynshhBPKsX5rwKP5Ay2ZsG2pKOmoSeGbEDsqp8CKwZbm_7qdKQoCdkKFMsYinZBM-ZMS9vBmiAxijgMDdGYIpteKUntfhfv8KhyphenhyphenaaF1dg/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to programmatically create a CustomerAddress in Dynamics CRM 2011/2013" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSE2thbXvM2QuAUPKKWBJCy5qEgXQJ8amG8UynshhBPKsX5rwKP5Ay2ZsG2pKOmoSeGbEDsqp8CKwZbm_7qdKQoCdkKFMsYinZBM-ZMS9vBmiAxijgMDdGYIpteKUntfhfv8KhyphenhyphenaaF1dg/s1600/2.png" height="282" title="How to programmatically create a CustomerAddress in Dynamics CRM 2011/2013" width="400" /></a></li>
</ol>
<br />
<ol>
</ol>
<h3 style="text-align: center;">
How to programmatically create a CustomerAddress in Dynamics CRM 2011/2013</h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<ol>
<li>When an Account is created, CRM creates by default 2 addresses for it, from the CustomerAddress entity type, which are called Address1 and Address2.</li>
<li>If you intend to programmatically update the Account or Contact address, and not to create a new address, you just instantiate the following Account fields with the data, and CRM will automatically update the corresponding CustomerAddresses objects related to the specific Account:</li>
</ol>
<blockquote class="tr_bq">
<span style="font-size: x-small;"><b>oAccount["address1_telephone1"]<br /> </b></span><span style="font-size: x-small;"><b>oAccount["address1_line1"]</b></span><span style="font-size: x-small;"><b>oAccount["address1_city"]</b></span><span style="font-size: x-small;"><b>oAccount["address1_postalcode"]</b></span></blockquote>
<br />
<br />
Change "Address1" with "Address2" if you want to update the second Account address.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: left;">
If you intend to create a new (third) CustomerAddress item for the Account, follow this step by step instructions:</div>
<br />
<ol>
<li>First we write a check to see whether we got a legal ID of the Account we want to refer to:<br /><br /><blockquote class="tr_bq">
<span style="font-size: x-small;"><b>if (guidParentAccount.HasValue)</b></span><span style="font-size: x-small;"><b>{</b></span></blockquote>
</li>
<li>Then we create the CustomerAddress entity , and instantiate the "ParentID" of the CustomerAddress . When creating a new address for an Account or a Contact entity, it's crucial to provide a reference field which points to the "ParentId" , that means , the Account or Contact to which belongs this new address. The C# code below instantiates the "ParentId" property with the actual Account , and not just the Parent's ID (guid) :<br /><br /><blockquote class="tr_bq">
<span style="color: #38761d; font-size: x-small;"><b>Entity oAccountAddress = new Entity("customeraddress"); </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>EntityReference parentID = new EntityReference(); </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>parentID.Id = guidParentAccount.Value; </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>parentID.LogicalName = "account";</b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> oAccountAddress.Attributes["parentid"] = parentID;</b></span></blockquote>
</li>
<li>However, if you try to instantiate this "ParentId" field with the guid, you will be confronted with an exception , that's raised informing that <b>the value is null</b> : this error message is misleading, and we wrote about it <a href="http://thecrmclub.blogspot.com/2014/12/how-to-fix-attribute-parentid-cannot-be-set-to-NULL-exception-in-Dynamics-CRM-2013-2011.html" target="_blank">in another article here</a>.</li>
<li>Another way, shorter, to instantiate the ParentID is the following:<br /><br /><span style="font-size: x-small;"><b>oAccountAddress["parentid"] = new EntityReference("account", guidParentAccount.Value );</b></span></li>
<li>Next we save the street in the "line1" field: for the example, here i made a street search by street code on a generic List<> which contains street codes and descriptions:<br /><blockquote class="tr_bq">
<span style="font-size: x-small;"><b> </b></span><br />
<span style="font-size: x-small;"><b><br /></b></span>
<span style="font-size: x-small;"><b> <span style="color: #38761d;">string sStreetDescription = String.Empty; </span></b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> if ( oStreetList != null && oStreetList.Count > 0 && iStreetCode > 0) </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> { </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> sStreetDescription = oStreetList.FirstOrDefault(sc => sc.Code == iStreetCode).Description; </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> if (sStreetDescription.Length > 0) </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> { </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> oAccountAddress["line1"] = sStreetDescription; </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> } </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> }</b></span></blockquote>
</li>
<li>Next we save the city in the "city" field: for this example, here i got a city object also from data migration, which contains both city code and description:<br /><br /><blockquote class="tr_bq">
<span style="color: #38761d; font-size: x-small;"><b>string sCityDescription = String.Empty; </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>if (oCity != null) </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>{ </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> sCityDescription = oCity.Description; </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> if (sCityDescription.Length > 0) </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> { </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> oAccountAddress["city"] = sCityDescription; </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> } </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>}</b></span></blockquote>
<span style="font-size: x-small;"><b><br /></b></span></li>
<li><div>
<br /></div>
</li>
<li>Then we instantiate the "postalcode" and "telephone1" properties:<br /><br /><blockquote class="tr_bq">
<span style="color: #38761d; font-size: x-small;"><b>if (oAccount.Zip != null) </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>{ </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b> oAccountAddress["postalcode"] = Convert.ToString(oAccount.Zip); </b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>}</b></span><br />
<span style="color: #38761d; font-size: x-small;"><b>oAccountAddress["telephone1"] = oAccount.Phone ?? "0";</b></span></blockquote>
</li>
<li>Finally we call the Organization Web Service to create the CustomerAddress entity from the Account:<br /><br /><span style="font-size: x-small;"><b>Guid? guidAccountAddress = XrmContext.Create(oAccountAddress);</b></span></li>
<li>The CRM database will then reflect the 3 addresses (AddressNumber 1,2 and 3) as shown here:<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwU034Lh-5EnmqieKQsqMdR7mGJvJq2LmsNiUPctN7Yu9hQbHZsoJu38oNFNFJ85JQcL1qNJk7Ny-SH5u7lLktcwmv1npHwIr8puzuknM2Df026KHOqOA5hAt2LYvX1jVH-CRABzKP0BY/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to programmatically create a CustomerAddress in Dynamics CRM 2011/20131" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwU034Lh-5EnmqieKQsqMdR7mGJvJq2LmsNiUPctN7Yu9hQbHZsoJu38oNFNFJ85JQcL1qNJk7Ny-SH5u7lLktcwmv1npHwIr8puzuknM2Df026KHOqOA5hAt2LYvX1jVH-CRABzKP0BY/s1600/1.png" height="102" title="How to programmatically create a CustomerAddress in Dynamics CRM 2011/20131" width="560" /></a><br /> </li>
</ol>
<blockquote class="tr_bq">
<br /></blockquote>
<br />
<b><i>That's all...Enjoy Dynamics CRM!!!</i></b><br />
<br />
by Carmel Schvartzman<br />
<br />
<div style="direction: rtl; text-align: right;">
<span style="color: #333333; font-family: 'Open Sans', sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span><br />
<div>
</div>
</div>
<ol></ol>
<br />Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com1tag:blogger.com,1999:blog-7170990797045135567.post-25687036007733494852015-04-13T12:49:00.000-07:002015-04-13T12:49:41.900-07:00How to name SQL parameters in an SSIS Execute SQL TaskIn this article we describe <b>Step by step How to name SQL parameters in an SSIS Execute SQL Task , to avoid the common </b><b>Sql Server Integration Services </b><b>error : "Parameter name is unrecognized." </b><br />
We follow here the conventions introduced by MSDN in the <strong style="color: #5d5d5d; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;"><a href="https://msdn.microsoft.com/en-us/library/cc280502.aspx" target="_blank">SQL Server documentation for SSIS</a></strong> . For explaining naming SQL parameters in an Execute SQL Task , we will make use of the following SSIS application:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaRVdkHasB8XgqoB-NoAEgXjwEwecEvRH7YyJC5aRdlUznkVOOobYtIleK_AuECBBUW5E8AG9pkVxBhhaGPAK7xzs5ops-GpFR0WvtVhIb7xOxM69coJZhm3UAYbpfq5G2V9WMGuad2elw/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt=" How to use SQL parameters in an Execute SQL Task " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaRVdkHasB8XgqoB-NoAEgXjwEwecEvRH7YyJC5aRdlUznkVOOobYtIleK_AuECBBUW5E8AG9pkVxBhhaGPAK7xzs5ops-GpFR0WvtVhIb7xOxM69coJZhm3UAYbpfq5G2V9WMGuad2elw/s1600/3.png" height="464" width="540" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="text-align: center;">
How to name SQL parameters in an SSIS Execute SQL Task</h3>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
We will want to give to the SQL parameters a proper name in order to avoid the "Execute SQL Task" error, that can be seen in the picture above : <b>"Parameter name is unrecognized." :</b><br />
<div>
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRS48kGxQCra0t50G0QP1znSfOfa2x9OKDL6nhEpQ1wW0QvimXyHf8y9h2nrQR3SCg6ZQwqkJppJGgLZmP9a_lIjpyaPHrW7DgHF1-zM6YyGDpbvm8r_m5PXzTwMttGtLtLYK8LRxstEi6/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt=" How to use Execute SQL Task " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRS48kGxQCra0t50G0QP1znSfOfa2x9OKDL6nhEpQ1wW0QvimXyHf8y9h2nrQR3SCg6ZQwqkJppJGgLZmP9a_lIjpyaPHrW7DgHF1-zM6YyGDpbvm8r_m5PXzTwMttGtLtLYK8LRxstEi6/s1600/4.png" height="326" width="540" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
The <a href="https://msdn.microsoft.com/en-us/library/cc280502.aspx" target="_blank">MSDN Documentation</a> explains that naming conventions for using SQL parameters in OLE DB should be as follows:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCIb4iLt6QLAYqkuos2f4Y9svMi4ELQA14EGMFGSoMsi8j_IzreRYGxlffKffpZpUNK7XHKUjvzZgniyq0X0Uw2Z-p7ejRVqSSGBqD2hFBSUi6Ui1xYWWbfgJD_bHGYPjTphj7txK_yUEz/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to use SQL parameters in an Execute SQL Task 1 " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCIb4iLt6QLAYqkuos2f4Y9svMi4ELQA14EGMFGSoMsi8j_IzreRYGxlffKffpZpUNK7XHKUjvzZgniyq0X0Uw2Z-p7ejRVqSSGBqD2hFBSUi6Ui1xYWWbfgJD_bHGYPjTphj7txK_yUEz/s1600/8.png" height="320" width="540" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Suppose that we have this SQL query which is using parameters. Then we must use the "?" marker this way :</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNH6K1oeDRT0nVJrcdD3BdRkVCu0puFx22VBmQEiWNtb2ymEmMfFk6uSAW4jt-_5Wtc4U2dLRqcqDZuUTc1v2gqsS57FISiBZ6aL4NuOGuwh_L-728dn6RehmFmpu45diWH-5uw1YeSemo/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt=" How to fix the SSIS error : Parameter name is unrecognized. 1 " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNH6K1oeDRT0nVJrcdD3BdRkVCu0puFx22VBmQEiWNtb2ymEmMfFk6uSAW4jt-_5Wtc4U2dLRqcqDZuUTc1v2gqsS57FISiBZ6aL4NuOGuwh_L-728dn6RehmFmpu45diWH-5uw1YeSemo/s1600/5.png" height="500" width="540" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
All parameters must be mapped to the query markers, and indexed base "0" . So, as we have 4 "?" markers, we must name 4 parameters indexed from "0" to "3" , using integer numbers conforming to the index positions:</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<span style="font-size: x-small;"><b><span style="color: #38761d;"> WHEN </span><span style="color: red;">? - ?</span><span style="color: #38761d;"> < 0 </span></b></span><b style="color: #38761d; font-size: small;"> </b></div>
<div class="separator" style="clear: both;">
<span style="font-size: x-small;"><b><span style="color: #38761d;"> WHEN </span><span style="color: red;">? - ?</span><span style="color: #38761d;"> > 0 </span></b></span></div>
<div class="separator" style="clear: both;">
<span style="color: #38761d; font-size: x-small;"><b> </b></span></div>
<div class="separator" style="clear: both;">
<span style="color: #38761d; font-size: x-small;"><b> </b></span></div>
<div class="separator" style="clear: both;">
<span style="color: #38761d; font-size: x-small;"><b> </b></span></div>
<div>
<br /></div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieRkqGpRzNe0fp4MfmwGT1bXWENtk7HH5FTA2H0ILvF4NUiVFJWhFE24poFjsun8O2N4kM2MT-ZYpQG2gj4R0DKFiAuVwAWj5iA90ybBH4l1wtM0VsJf8mCfLiGRVWIgaK5RxE8a8K8V84/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt=" How to use SQL parameters 2 " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieRkqGpRzNe0fp4MfmwGT1bXWENtk7HH5FTA2H0ILvF4NUiVFJWhFE24poFjsun8O2N4kM2MT-ZYpQG2gj4R0DKFiAuVwAWj5iA90ybBH4l1wtM0VsJf8mCfLiGRVWIgaK5RxE8a8K8V84/s1600/6.png" height="328" width="540" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="direction: rtl;">
<div>
<div style="text-align: left;">
<b>That's all...Enjoy Dynamics CRM</b></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
by Carmel Schvartzman</div>
<div style="text-align: left;">
<br /></div>
<div style="direction: rtl; text-align: right;">
<div style="text-align: left;">
<span style="color: #333333; font-family: 'Open Sans', sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span></div>
<div>
</div>
</div>
<ol></ol>
<div style="text-align: left;">
<br /></div>
<br />
<br /></div>
<div>
</div>
</div>
</div>
Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-34917881567584615892014-12-03T13:25:00.001-08:002014-12-03T13:25:13.825-08:00How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011)<ol>
<li>In this article we see how to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) .<br /><br /><img alt="How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6aaIBKrY4TINFuUPGeo_0XVcpe02XN3dYygdLYJ4s36PVxInkSgqn8EPXl4aGXNyIzEeqBDAHcIxK6cRw2pO26DdLS_irHpbyXfN_eEHj6v1FTzf4MczSsDFdtI6Rku1p5LpXmsDC0K8/s1600/1.png" height="138" style="color: #0000ee; text-align: center;" title="How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) " width="540" /></li>
</ol>
<h3 style="text-align: center;">
How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011)</h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<ol>
<li>This error appears in Dynamics CRM 2011 - 2013 custom Plugins or custom Workflows, or any C# code calling the Organization Web Service WCF endpoint using late binding. Specifically we're creating a new address for an Account or a Contact entity. The CustomerAddress CRM entity has a reference field which points to the "ParentId" , the Account or Contact to which belongs this new address :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuwY2i8zauGRcPOmwEiNiDGfkAj9Gts8jr46q7nDhsFJ7i2knTeNvBhg3ic7iSKaZd34Gmk_iqhVjQcfhSLv72xAK4QiHrS7Q4qr4wl4OUiSdRgjEkX9oeJHCN5-2hOz7sF-ASEgKHQ9I/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) 1" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuwY2i8zauGRcPOmwEiNiDGfkAj9Gts8jr46q7nDhsFJ7i2knTeNvBhg3ic7iSKaZd34Gmk_iqhVjQcfhSLv72xAK4QiHrS7Q4qr4wl4OUiSdRgjEkX9oeJHCN5-2hOz7sF-ASEgKHQ9I/s1600/2.png" height="304" title="How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) 1" width="540" /></a></li>
<li>The C# code above instantiates the "ParentId" field with the actual Account ID (guid) . The guid is guaranteed to contain a Value, elsewhere the code inside the brackets wouldn't be executed :<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdKqu3xjylMpwcZEd5Om5OmmGI6FBoJCU7ZFDPOm3RVJhSuYZQ66e0OhDsl9O9idx0Ayp-Do3_aTco5xvpHowtWLcWjAoF0SWW3qN5NIYPHlbXEYi-zCeN-3Ln9p5rWEI98HUYUoNCeho/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) 2" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdKqu3xjylMpwcZEd5Om5OmmGI6FBoJCU7ZFDPOm3RVJhSuYZQ66e0OhDsl9O9idx0Ayp-Do3_aTco5xvpHowtWLcWjAoF0SWW3qN5NIYPHlbXEYi-zCeN-3Ln9p5rWEI98HUYUoNCeho/s1600/3.png" height="304" title="How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) 2" width="540" /></a><br /></li>
<li>However, there is an exception raised , expressing that <b>the value is null</b> : the error message is misleading, since the data type of the CRM SQL column is indeed "uniqueidentifier" , therefore a Guid, which we tried to insert in the attribute:</li>
<li><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-qhG6MoAxdBY_0X6iYC4CSKY3a5-bd9H_JNW5vPvZv-ZFRXDZKRCBu49YZE65gT1K3SEwLUAc__Fg5MC-JS2jCQf5iSIv0ZRVSu19sG5C3DJHj_gVO3-FGJKOFASISAOk5qbFVCmpe7M/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) 3" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-qhG6MoAxdBY_0X6iYC4CSKY3a5-bd9H_JNW5vPvZv-ZFRXDZKRCBu49YZE65gT1K3SEwLUAc__Fg5MC-JS2jCQf5iSIv0ZRVSu19sG5C3DJHj_gVO3-FGJKOFASISAOk5qbFVCmpe7M/s1600/4.png" height="540" title="How to fix the "Attribute: parentid cannot be set to NULL" exception in Dynamics CRM 2013 (2011) 3" width="498" /></a><br /><br /></li>
<li>You wouldn't imagine that that is not enough for CRM, and that it is expecting to get another Type at all: an "EntityReference" CRM type, and not just a Guid:<br /><br /> </li>
</ol>
<blockquote class="tr_bq">
<span style="font-size: x-small;"><b> /* CREATE PARENT REFERENCE FOR CUSTOMER ADDRESS */</b></span><span style="font-size: x-small;"><b><br /></b></span><span style="font-size: x-small;"><b> <span style="color: red;">EntityReference </span>parentID = <span style="color: red;">new EntityReference</span>();</b></span><span style="font-size: x-small;"><b> parentID.Id = guidParentAccount.Value;</b></span><span style="font-size: x-small;"><b> parentID.LogicalName = "<span style="color: #38761d;">account</span>";</b></span><span style="font-size: x-small;"><b><br /></b></span><span style="font-size: x-small;"><b> oAccountAddress.Attributes["<span style="color: #38761d;">parentid</span>"] = parentID;</b></span><span style="font-size: x-small;"><b><br /></b></span><span style="font-size: x-small;"><b> </b></span><span style="font-size: x-small;"><b> /***************************************************/</b></span></blockquote>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<br />
This way you get rid of the error, giving to the CRM Organization Service exactly what it needed.<br />
There is another way to write the code above, shorter, as follows:<br />
<blockquote class="tr_bq">
<span style="font-size: x-small;"><b><br /></b></span><span style="font-size: x-small;"><b> /* CREATE PARENT REFERENCE FOR CUSTOMER ADDRESS */</b></span><span style="font-size: x-small;"><b><br /></b></span><span style="font-size: x-small;"><b> oAccountAddress["<span style="color: #38761d;">parentid</span>"] = <span style="color: red;">new EntityReference</span>("<span style="color: #38761d;">account</span>", guidParentAccount.Value );</b></span><span style="font-size: x-small;"><b> </b></span><span style="font-size: x-small;"><b> </b></span><span style="font-size: x-small;"><b> /***************************************************/</b></span></blockquote>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<br />
<br />
That's all...Enjoy Dynamics CRM<br />
<br />
by Carmel Schvartzman<br />
<br />
<div style="direction: rtl; text-align: right;">
<span style="color: #333333; font-family: 'Open Sans', sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span><br />
<div>
</div>
</div>
<ol>
</ol>
<br />
<br />
<br />
<br />
<br />
<br />
<br />Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0tag:blogger.com,1999:blog-7170990797045135567.post-24666253546702582982014-11-18T00:29:00.000-08:002014-11-18T00:29:41.405-08:00How to install Business Intelligence Development Studio (BIDS) for Visual Studio 2012 Sql Server 2008<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<ol>
<li>In this walkthrough we will learn <b>How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008</b> </li>
<li>The Business Intelligence Development Studio (BIDS) is an add-on to Visual Studio 2012 and Sql Server 2008. The BIDS includes the SSIS - Sql Server Integration Services templates for developing SSIS projects on Visual Studio 2012. Here we'll see step by step how to install it :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWf-WPE3w5vwALagf_KONl1waEMbme5HeZKi2YIKSd_xsfQAeRlgSjdxKuvhjWyKzZp3QAxCd123LgWas67XN7cemDCmt2gxh_Yf_lOYhVmdb_Yvz21bOHSSKcl8rcaUGQTjY7DYu4Io/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="SSIS - Sql Server Integration Services" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWf-WPE3w5vwALagf_KONl1waEMbme5HeZKi2YIKSd_xsfQAeRlgSjdxKuvhjWyKzZp3QAxCd123LgWas67XN7cemDCmt2gxh_Yf_lOYhVmdb_Yvz21bOHSSKcl8rcaUGQTjY7DYu4Io/s1600/9.png" height="474" title="SSIS - Sql Server Integration Services" width="540" /></a></li>
</ol>
<h3 style="text-align: center;">
How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 Sql Server 2008</h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<ol>
<li>Browse to the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=36843" target="_blank">Microsoft Download Center</a> to get the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=36843" target="_blank">Visual Studio 2012 templates for the BIDS</a>, which also includes the SSIS - Sql Server Integration Services :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpUBHXF-3oxBzWPo9HRW93xFvdJMcTv16zqvYswlyelIseWm9DJhgpfxekU-s0v7F5ctFeq9Hnh3paDkO748qT8FhpBuHjowd4PCQVErpy45qGWtezLz6kjMx2qC0wHYFpIXC1Z2XYssE/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpUBHXF-3oxBzWPo9HRW93xFvdJMcTv16zqvYswlyelIseWm9DJhgpfxekU-s0v7F5ctFeq9Hnh3paDkO748qT8FhpBuHjowd4PCQVErpy45qGWtezLz6kjMx2qC0wHYFpIXC1Z2XYssE/s1600/1.png" height="316" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008" width="540" /></a></li>
<li>Download it to your machine and run it as administrator:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn_4Ti9zNyXAVEf_c_lwWFHZ7Pao-j9NERR1IMBt9-hKaKVtiSuYw3Y8X8lICaA8jiHRo6tLYXDZu_KpIaLr41_PSbveNbMkIabj02p4j8OJxlaks8mKbh6r8t3u3bqW_LBhYWzeDBCwA/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 1" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn_4Ti9zNyXAVEf_c_lwWFHZ7Pao-j9NERR1IMBt9-hKaKVtiSuYw3Y8X8lICaA8jiHRo6tLYXDZu_KpIaLr41_PSbveNbMkIabj02p4j8OJxlaks8mKbh6r8t3u3bqW_LBhYWzeDBCwA/s1600/2.png" height="480" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 1" width="540" /></a></li>
<li>Click the "Install" button :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHGFgp2RZFng5vw_NaT05v2B87lB0FIj-cavjQt-_CWbbieUEDc8aPQODPPifp5tI-5wBHO8r8v9Q9VPytg37r7O3HlP1x2roIODsPJTfuZSx-AmO8UUUUXLxs_cMETS4EvDNc7-G84pA/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 2" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHGFgp2RZFng5vw_NaT05v2B87lB0FIj-cavjQt-_CWbbieUEDc8aPQODPPifp5tI-5wBHO8r8v9Q9VPytg37r7O3HlP1x2roIODsPJTfuZSx-AmO8UUUUXLxs_cMETS4EvDNc7-G84pA/s1600/3.png" height="480" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 2" width="540" /></a></li>
<li>Make sure that the Business Intelligence for Visual Studio 2012 box is checked :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbR8c21BdB8xVyjZ_xPUeA9uKiHYNhCNQDDTDyr23HCXzs5sWrH5egEanxr006IND8ZpfYaklYjHrRGGjWi2fAL8zdkPUROpkXu4hNs7Jzx51t6rW5m1ovyPTurwJG_59obuxWHZdRqCE/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 3" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbR8c21BdB8xVyjZ_xPUeA9uKiHYNhCNQDDTDyr23HCXzs5sWrH5egEanxr006IND8ZpfYaklYjHrRGGjWi2fAL8zdkPUROpkXu4hNs7Jzx51t6rW5m1ovyPTurwJG_59obuxWHZdRqCE/s1600/4.png" height="398" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 3" width="540" /></a></li>
<li>Click "Next" :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1yjZ_H8p3sDNyRLoAjCfrD24ZjpUHhzyCRNQ8yDKQ1sW7o4H-YINx7dj2FSQZ9xXCh43PJppvHILfeGnzdHlJ6YW0LhWcgr1sOz_WsluiFXWbHWIazMlyz3x6CllNJEFr22s1Sf66oyQ/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 4" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1yjZ_H8p3sDNyRLoAjCfrD24ZjpUHhzyCRNQ8yDKQ1sW7o4H-YINx7dj2FSQZ9xXCh43PJppvHILfeGnzdHlJ6YW0LhWcgr1sOz_WsluiFXWbHWIazMlyz3x6CllNJEFr22s1Sf66oyQ/s1600/5.png" height="396" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 4" width="540" /></a></li>
<li>Check that the installation has been successful :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSalGk3Fk0aBOHgmdqfLzjyd6EEhngxG_VxQQkFy7UChLdW2-Irl4wlh8q-J7vGiXp5ksplfm4iGCO7RSDbvzAtghqgB0bS8TayvxPY0yZNZMBDg_AMOofPshcpNkAFMVhgVBUNikY7zM/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 5" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSalGk3Fk0aBOHgmdqfLzjyd6EEhngxG_VxQQkFy7UChLdW2-Irl4wlh8q-J7vGiXp5ksplfm4iGCO7RSDbvzAtghqgB0bS8TayvxPY0yZNZMBDg_AMOofPshcpNkAFMVhgVBUNikY7zM/s1600/6.png" height="400" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 5" width="540" /></a><br /><br /> </li>
<li>Now let's see how it has the Visual Studio 2012 upgraded. Before the installation, Visual Studio 2012 templates for new projects looked like this :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_CeZt2oaLoF0bvOHjg0I2kKy6NmyOuDcm_cVSFvKES5TrmAuGUI38CbxkKyWKkWyEfsIiT8b_FiEVNFzmwX-XQrSPBLO_HTMnIg2vn8sCeBI8lV_c_wy7i13I8pnWw9iwlcqhlb15HUw/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 6" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_CeZt2oaLoF0bvOHjg0I2kKy6NmyOuDcm_cVSFvKES5TrmAuGUI38CbxkKyWKkWyEfsIiT8b_FiEVNFzmwX-XQrSPBLO_HTMnIg2vn8sCeBI8lV_c_wy7i13I8pnWw9iwlcqhlb15HUw/s1600/7.png" height="446" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 6" width="540" /></a></li>
<li>Now, after the installation, the Visual Studio 2012 templates include the ones for Business Intelligence , SSIS between them:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihvyQZ02Y83GjxBjFtRtkOEQUA1UpLTteJMUgHK_La95N6dmNAVcGrY_R6FWAFCQ68Mw5XUpX4grtwolYKQcVgU6yjYEhTaUaxoicvi3tKNXNeInqaNyCkpNlEL3vMg8gzTfzzLLho9xs/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 7" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihvyQZ02Y83GjxBjFtRtkOEQUA1UpLTteJMUgHK_La95N6dmNAVcGrY_R6FWAFCQ68Mw5XUpX4grtwolYKQcVgU6yjYEhTaUaxoicvi3tKNXNeInqaNyCkpNlEL3vMg8gzTfzzLLho9xs/s1600/8.png" height="334" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 7" width="540" /></a></li>
<li>Now you can create a new <span style="font-weight: normal;">SSIS - Sql Server Integration Services project using the </span>Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 :<br /><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWf-WPE3w5vwALagf_KONl1waEMbme5HeZKi2YIKSd_xsfQAeRlgSjdxKuvhjWyKzZp3QAxCd123LgWas67XN7cemDCmt2gxh_Yf_lOYhVmdb_Yvz21bOHSSKcl8rcaUGQTjY7DYu4Io/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 8" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWf-WPE3w5vwALagf_KONl1waEMbme5HeZKi2YIKSd_xsfQAeRlgSjdxKuvhjWyKzZp3QAxCd123LgWas67XN7cemDCmt2gxh_Yf_lOYhVmdb_Yvz21bOHSSKcl8rcaUGQTjY7DYu4Io/s1600/9.png" height="474" title="How to install Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 8" width="540" /></a></li>
<br />
<li>In this walk-through we've learned how to install the Business Intelligence Development Studio (BIDS) on Visual Studio 2012 and Sql Server 2008 .</li>
<li>That's all...Enjoy Dynamics CRM<br /><br />by Carmel Schvartzman<br /><br /><div style="direction: rtl; text-align: right;">
<span style="color: #333333; font-family: 'Open Sans', sans-serif; font-size: x-small; line-height: 19px;">כתב: כרמל שוורצמן</span><br />
<div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
</div>
</li>
</ol>
<br />Carmel Shvartzmanhttp://www.blogger.com/profile/02395781739227543283noreply@blogger.com0