Showing custom warning message on an entity form in CRM


Hi,

I was searching for a way to show custom warning message in an entity’s form and came across these two helpful posts

For CRM 4 :-

http://social.microsoft.com/Forums/br/crmdevelopment/thread/1791ab40-a1e6-4099-bb4b-6e52a9a45c18

For CRM 2011 : –

http://crm2011wiki.wordpress.com/2012/04/16/showing-custom-alerts-in-notifications-area/

Hope it helps.

 

“Object doesn’t support property or method ‘setFormMode’” error while closing the record’s form in CRM 2011.


Hi,

We had recently written a plugin for sending email. In the description of the email we were inserting the URL of the record

string recordUrl = string.Format(“<a href=’{0}/userdefined/edit.aspx?etc=4300&id={1}‘>Click here to open the record</a>”, this.serverName, marketingListGuid.ToString());

While clicking the link the record opens properly, however when we try closing the form’s window we get the below error

We have UR8 installed in our on premise development environment there we don’t get this error, however we are still getting the above error for our online dev and production environment.

http://social.microsoft.com/Forums/lv-LV/crmdevelopment/thread/0c0aa09e-0ea6-4150-8056-a2b7b91f3256?prof=required

Bye.

“The import file is too large to upload” error while importing csv file of more than 8 mb in CRM 2011.


Hi,

I was importing a csv file of size 11 mb using import data feature and got the below error.

The unsupported way we can resolve it for our on premise environment is by running the following update query against MSCRM_CONFIG database.

UPDATE ServerSettingsProperties

SET IntColumn =15

where columnname=‘ImportMaxAllowedFileSizeInMB’

Also refer to this support article

http://support.microsoft.com/kb/918609

Bye.

List of all the tools and resources for Microsoft Dynamics CRM 2011.


Hi,

Got to know about this wonderful CRM Wiki page today, so just thought of sharing it.

http://social.technet.microsoft.com/wiki/contents/articles/2490.microsoft-dynamics-crm-2011-development-resources.aspx

Thanks George Doubinski and Ben Hosking for publishing it.

Bye.

Installing Microsoft Dynamics CRM 4.0 in Windows Server 2008 R2 machine having Microsoft SQL Server 2008 database.


Hi,

These are the steps we followed to install Microsoft Dynamics CRM 4.0 in Windows Server 2008 R2 machine (Here we had the Microsoft SQL Server 2008 installed on a different server)

Before running the setup, first we added the .NET Framework 3.5.1 Features from Server Manager.

After running the installer we got the following error in the Environment Diagnostics Wizard.

 ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )

We followed the step mentioned in this article to resolve this issue.

http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/

On running the installer again, we got this issue

Error : Service msftesql was not found on computer …… The specified service does not exist as an installed service.


We followed the below mentioned steps to resolve the issue

  1. Run > Regedit
  2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  3. Rename MSSQLFDLauncher Folder to msftesql
  4. Reboot System
  5. Administrative Tools > Services > SQL Full-text Filter Daemon Launcher (MSSQLSERVER) and Check START Status
  6. Rename back msftesql Folder to MSSQLFDLauncher

http://social.microsoft.com/Forums/eu/crm/thread/d8dda562-aae6-47b7-9c81-86f98d2b77f6

Bye.

Showing related entity information in Header as Hyperlink – CRM 2011


We recently had requirement to show the Case Information in one of its related (related) entity’s header. The information should appear as a hyperlink so that users can open the case directly from that entity’s form.

Case entity was having 1-n relationship with this other entity say Entity A and Entity A was related 1-n with Entity B. In Entity A we had moved the lookup of Case in the header. So from Entity A’s form user could click the lookup in header (as lookup appeared as hyperlink in Header) and open the Case.

Now they wanted the similar kind of functionality in Entity B. However as Entity B was not directly related to Case entity it had no lookup or any other field having Case information in it.

So this is what we did :-

  1. Created a new HTML Web Resource.
  2. Added an anchor tag in it.
  3. Used JavaScript to get the Case Information from the lookup of the Entity A in the form.
  4. Dynamically setting the href and innerHTML of the anchor tag so that it provides case information and link clicking on which should open the case record.
  5. Add the Web Resource in the header of the Entity B form.
  6. As we were using JSON here, added the JSON library in the form load.

    Case Information in the header and the hyperlink:-

Sample Code of the HTML Web Resource:-


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>Case Information</title>
 <script src="ClientGlobalContext.js.aspx"></script>
 <script type="text/javascript" src="new_json2"></script>
 <style type="text/css">
 .ms-crm-Field-Normal
 {
 font-family: Segoe UI, Tahoma, Arial;
 font-size: 13px;
 position:absolute;
 top:0px;
 text-align: left;
 }


 </style>
 <meta charset="utf-8">
</head>
<body style="background-color: #f7fbff; margin: 10px" onload="GetCaseInformation()"
 contenteditable="true">
 <a id="anchorCase" href="#" target="_blank" class="ms-crm-Field-Normal"></a>
 <script>

var FORM_TYPE_UPDATE = 2;
 var FORM_TYPE_READ_ONLY = 3;
 var FORM_TYPE_DISABLED = 4;


 var ODataPath;
 var serverUrl;
 var entityName = "";
 var id = "";
 var entity;

function GetCaseInformation() {
 init();
 }

function init() {


 serverUrl = document.location.protocol + "//" + document.location.host + "/" + Xrm.Page.context.getOrgUniqueName();
 ODataPath = serverUrl + "/XRMServices/2011/OrganizationData.svc";
 if (parent.Xrm.Page.ui.getFormType() == FORM_TYPE_UPDATE ||
 parent.Xrm.Page.ui.getFormType() == FORM_TYPE_READ_ONLY ||
 parent.Xrm.Page.ui.getFormType() == FORM_TYPE_DISABLED) {

// get the lookup control and its guid and entity type
 var value = parent.Xrm.Page.ui.controls.get('new_casemedicalconditionid').getAttribute().getValue();

if (value != null) {
 id = value[0].id.replace('{', '').replace('}', '');
 entityName = value[0].entityType;
 }
 }
 // get the case information
 retrieveRecord(id);
 }

function retrieveRecord(Id) {
 var retrieveReq = new XMLHttpRequest();
 var url = ODataPath + "/" + entityName + "Set(guid'" + Id + "')";

retrieveReq.open("GET", ODataPath + "/" + entityName + "Set(guid'" + Id + "')", true);
 retrieveReq.setRequestHeader("Accept", "application/json");
 retrieveReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
 retrieveReq.onreadystatechange = function () {
 retrieveReqCallBack(this);
 };
 retrieveReq.send();
 }

function retrieveReqCallBack(retrieveReq) {


 if (retrieveReq.readyState == 4 /* complete */) {
 if (retrieveReq.status == 200) {
 //Success

 entity = JSON.parse(retrieveReq.responseText).d;
 if (entity.new_CaseId != null) {
 var caseGuid = entity.new_CaseId.Id;
 var caseName = entity.new_CaseId.Name;
 var serverUrl = document.location.protocol + "//" + document.location.host + "/" + Xrm.Page.context.getOrgUniqueName();
 if (document.getElementById('anchorCase').innerHTML == "") {
 document.getElementById('anchorCase').innerHTML = caseName;
 document.getElementById('anchorCase').href = serverUrl + "/CS/cases/edit.aspx?id={" + caseGuid + "}";
 }
 }
 }
 }
 }

</script>
</body>
</html>


Bye.