If you are apologist of 100% supported solutions for Dynamics CRM this is a good place to close this article because it describes approach that will allow to open standard lookup dialog window of CRM and get selected values from it. Of course that customization is unsupported.
Showing posts with label Unsupported. Show all posts
Showing posts with label Unsupported. Show all posts
Wednesday, January 07, 2015
Friday, June 13, 2014
Dynamics CRM 2013: Step-by-step creating dialog windows
In my previous post I shared how to use Microsoft CRM internal function to show dialog window in Dynamics CRM 2013 inline style. In this post I will write step-by-step guide how to build own dialogs in CRM 2013 style.
Labels:
Java Script,
Microsoft CRM 2013,
Undocumented,
Unsupported
Monday, May 26, 2014
Show your dialog in CRM 2013 modal style
With CRM 2013 we have got one working window without any pop-up windows (lookups, dialogs, e.t.c.). But… only for standard features. What to do in case you wanted to use the same approach with modal windows as CRM does it? I walked through SDK and found following article - http://msdn.microsoft.com/en-us/library/jj602956.aspx#BKMK_OpenWebResource. I tried the code but I have got wrapped window.open method. After some investigations I found how CRM does it:
if (typeof Custom == "undefined") { Custom = { OpenDialog: function (webresource) { var $v_0 = new Mscrm.CrmDialog(Mscrm.CrmUri.create(webresource), window, 370, 370, null); $v_0.show(); }, __namespace: true }; }
and usage is following:
Custom.OpenDialog("/webresources/new_webresource.htm");
You can use this approach but remember that this code uses undocumented methods so it could be broken with any rollup.
Labels:
Java Script,
Microsoft CRM 2013,
Undocumented,
Unsupported,
WebResource
Monday, February 10, 2014
MS CRM 2013: OOB BingMaps control shows ‘click here to view map’ – what to do?
This article can help you to activate this feature for On Premise deployment only! This would not work for Online!
If you see something similar when you open your CRM Organization that means that for some reason MS decided to limit your possibility to see location of contact, account or other record on map:
To fix it do following steps:
1. Connect to SQL Server where DBs are located.
2. Open SQL Management Studio and execute following query against your CRM DB:
That will give you locale code of your organization. Now you need to convert this value to culture name (for example using this post) – in my case ru-RU.
3. Execute following query against MSCRM_Config DB:
That will give you the list of locales for which BingMaps would work (in my case it was cs-CZ;da-DK;nl-BE;nl-NL;en-AU;en-CA;en-IN;en-GB;en-US;fi-FI;fr-CA;fr-FR;de-DE;it-IT;ja-JP;nb-NO;pt-BR;pt-PT;es-MX;es-ES;es-US;sv-SE).
4. Write and execute script to update list of locales using following template:
In my case:
5. Make iisreset and try to open form where bingmaps was not shown before. If you’ve done everything right map had to appear:
PS This modifications are unsupported and mentioned changes can harm your deployment. Use it own risk.
If you see something similar when you open your CRM Organization that means that for some reason MS decided to limit your possibility to see location of contact, account or other record on map:
To fix it do following steps:
1. Connect to SQL Server where DBs are located.
2. Open SQL Management Studio and execute following query against your CRM DB:
Select LocaleId From Organization
3. Execute following query against MSCRM_Config DB:
Select NVarCharColumn From ServerSettingsProperties Where ColumnName = 'AvailableBingMapLocales'
4. Write and execute script to update list of locales using following template:
Update ServerSettingsProperties Set NVarCharColumn = 'Value from step 3;Value from step 2' Where ColumnName = 'AvailableBingMapLocales'
Update ServerSettingsProperties Set NVarCharColumn = 'cs-CZ;da-DK;nl-BE;nl-NL;en-AU;en-CA;en-IN;en-GB;en-US;fi-FI;fr-CA;fr-FR;de-DE;it-IT;ja-JP;nb-NO;pt-BR;pt-PT;es-MX;es-ES;es-US;sv-SE;ru-RU' Where ColumnName = 'AvailableBingMapLocales'
PS This modifications are unsupported and mentioned changes can harm your deployment. Use it own risk.
Labels:
BingMap,
Microsoft CRM 2013,
T-SQL,
Trick,
Unsupported
Sunday, January 12, 2014
MS CRM 2011/2013: Open new email form with To and Regarding fields prefilled
About a year ago I wrote small article how to open new activity form with Regarding field prefilled.
This week I had a similar task but this time I had to write a JavaScript that will open email form with To field prefilled. So here is the script that you can use:
Here is sample of usage:
This small JavaScript will open new email form with Regarding and To fields prefilled with contact with Id that equals to "c8576fa9-155e-e311-bbc5-6c3be5a8d218".
This week I had a similar task but this time I had to write a JavaScript that will open email form with To field prefilled. So here is the script that you can use:
function OpenEmail(recordid, recordtypecode) { var params = "pId=" + recordid + "&pName=&pType=" + recordtypecode; params += "&partyid=" + recordid + "&partyname=&partytype=" + recordtypecode; var url = "/main.aspx?etc=4202&pagetype=entityrecord&extraqs=" + encodeURIComponent(params); url = Xrm.Page.context.prependOrgName(url); window.open(url); }
OpenEmail("c8576fa9-155e-e311-bbc5-6c3be5a8d218", 2);
Labels:
Java Script,
Microsoft CRM 2013,
Unsupported
Thursday, October 31, 2013
Microsoft CRM 2013: Adding standard Bing Map control to forms of custom entities
In CRM 2013 Microsoft released really great feature – OOB integration with BingMaps. Unfortunately list of entities that support BingMaps control is limited to Account, Contact, Lead, Quote, Order, Invoice, Competitor and System User.
I did small investigation how this control is organized and I can confirm that it is possible to add OOB Bing Maps control to forms of custom entities. But be careful - provided solution is 100% unsupported but doesn’t require any knowledge of development, JavaScript, HTML and so on.
I did small investigation how this control is organized and I can confirm that it is possible to add OOB Bing Maps control to forms of custom entities. But be careful - provided solution is 100% unsupported but doesn’t require any knowledge of development, JavaScript, HTML and so on.
Labels:
BingMap,
Microsoft CRM 2013,
Unsupported
Monday, January 21, 2013
MS CRM 2011: Add new Deployment Administrator through SQL
Here is just short script that has to be executed against MSCRM_Config db to add new deployment administrator:
So the only thing you need to do is to put domain name of new deployment administrator in a format DOMAIN\Login like Contoso\Administrator.
This trick is 100% unsupported and can lead to malfunction of whole CRM deployment. I suggest you to take backup of MSCRM_Config DB before you run this script.
Declare @DomainName Varchar(Max) Set @DomainName = 'Put new deployment admin login here'--i.e. 'Contoso\Administrator' Declare @Id uniqueidentifier Select @Id = Id From mscrm_config..SystemUser Where Name = @DomainName if (@Id is null) Begin Set @Id = NEWID() INSERT INTO mscrm_config..SystemUser(Id, Name, DefaultOrganizationId) VALUES(@Id, @DomainName, '00000000-0000-0000-0000-000000000000') End INSERT INTO mscrm_config..SystemUserRoles(Id, SecurityRoleId, SystemUserId) VALUES(NEWID(), (Select Id From mscrm_config..SecurityRole Where Name = 'Administrator'), @Id)
So the only thing you need to do is to put domain name of new deployment administrator in a format DOMAIN\Login like Contoso\Administrator.
This trick is 100% unsupported and can lead to malfunction of whole CRM deployment. I suggest you to take backup of MSCRM_Config DB before you run this script.
Labels:
Microsoft CRM 2011,
T-SQL,
Unsupported
Thursday, January 10, 2013
MS CRM 2011: Open new activity form with ‘Regarding’ field prefilled
I had a task today to open new task form with Regarding field prefilled. Based on SDK description I tried to use following code to accomplish my task:
var params = { regardingobjectid: referenced record id, regardingobjectidtype: referenced record type name, regardingobjectidname: referenced record display name }; Xrm.Utility.openEntityForm("task", null, params);
I knew that this feature works for out of box buttons so I rechecked URL for activities that are created with OOB buttons and reworked code to following which worked without issues:
var params = { pId: referenced record id, pType: referenced record type code, pName: referenced record display name }; Xrm.Utility.openEntityForm("task", null, params);
Labels:
Java Script,
Microsoft CRM 2011,
Unsupported
Saturday, March 03, 2012
MS CRM 2011: Extended handling of Save events in Microsoft Dynamics CRM 2011
About 1.5 ago I wrote post which describes how to work with additional parameters during save of form. I decided to go through all available standard forms and create extended list of available parameters.
Labels:
Java Script,
Microsoft CRM 2011,
Undocumented,
Unsupported
Thursday, February 23, 2012
MS CRM 2011: Bulk refresh of user details from AD
When you create user in CRM all the available information is populated from AD into CRM user form. But in case information was changed in AD (email box, phone e.t.c.) - information will remain unchanged till the moment you will open form of user and change it. In case a lot of information was changed it will be quite boring to update users information one-by-one.
Following post describes how to allow bulk update of user details.
Following post describes how to allow bulk update of user details.
Wednesday, February 08, 2012
CRM 2011: Playing with notes control
If you want for some reason to allow/disallow user to insert or edit notes in Microsoft Dynamics CRM 2011 following code can help you:
Copy script, insert it to webresource, add this webresource to required form and call it during onload/onchange of form. And you should not forget that this script is unsupported because it uses document object and it's methods.
function FormatNotesControl(AllowInsert, AllowEdit)
{
var notescontrol = document.getElementById('notescontrol');
if (notescontrol == null)
return;
var url = notescontrol.src;
if (!AllowInsert)
url = url.replace("EnableInsert=true", "EnableInsert=false");
if (!AllowEdit)
url = url.replace("EnableInlineEdit=true", "EnableInlineEdit=false");
notescontrol.src = url;
}
function DisableNotesInsert()
{
FormatNotesControl(false, true);
}
Copy script, insert it to webresource, add this webresource to required form and call it during onload/onchange of form. And you should not forget that this script is unsupported because it uses document object and it's methods.
Labels:
Java Script,
Microsoft CRM 2011,
Unsupported
CRM 2011: Creating a Network Path Text Control for Microsoft Dynamics CRM 2011
Following approach is a little bit unsupported so be careful using it.
Create JavaScript webresource, put in it following code, call OnLoad method during loading of form of your entity:
Field has to be simple text type. Replace new_name with field you want to transform. Result for my case:
Create JavaScript webresource, put in it following code, call OnLoad method during loading of form of your entity:
function OnLoad()
{
Transform("new_name");
}
function Transform(fieldid)
{
var c = document.getElementById(fieldid);
if (c == null)
return;
c.style.textDecoration = "underline";
c.style.color = "blue";
c.style.cursor = "hand";
c.ondblclick = function()
{
window.open(Xrm.Page.getAttribute(fieldid).getValue());
};
}
Field has to be simple text type. Replace new_name with field you want to transform. Result for my case:
Labels:
Java Script,
Microsoft CRM 2011,
Unsupported
Sunday, June 20, 2010
Extended handling of save event in forms with close dialog (like opportunitites)
All developers who developed JavaScripts for CRM read this article. But there is no info about getting data from fields of "Close dialogue" (like opportunity close). I've made a little research on this theme and here is the result:
Labels:
Java Script,
Microsoft CRM 4.0,
Undocumented,
Unsupported
Sunday, June 13, 2010
Set default view for Service Calendar in Microsoft Dynamics CRM 4.0
My customer asked me to set default view for Service Calendar to 'Facility/Equipment'. I haven't found any available supported solution for this task, so I decided to use unsupported approach - inserting JavaScript in page of Service Calendar.
Labels:
Java Script,
Microsoft CRM 4.0,
Unsupported
Wednesday, January 20, 2010
Making Description Field Required in Close Opportunity Dialog
This is unsupported customization, so be careful.
Open folder with your CRM website. Open SFA\opps subcatalog.
Open folder with your CRM website. Open SFA\opps subcatalog.
Labels:
Java Script,
Microsoft CRM 4.0,
Unsupported
Tuesday, January 05, 2010
Handling Rollup message with plugins in Microsoft Dynamics CRM 4.0
There are no Rollup message in the list of supported message in SDK. Following trick will help developers to handle this message.
Labels:
C#,
Microsoft CRM 4.0,
T-SQL,
Unsupported
Subscribe to:
Posts (Atom)


