The message box used here is a VB message box. to use VB in JScript, execScript function is used.
function window.confirm(str)
{
execScript("n = msgbox('" +str+ "','4132', 'Title')", 'vbscript');
return( n == 6);
}
Monday, November 10, 2008
JScript Scripts for User info and User Roles for Client Side
based on some sources and my alterations:
Bill Owens : http://billoncrmtech.blogspot.com/2008/07/client-side-scripting-retrieving.html
Ronald Lehman : http://ronaldlemmen.blogspot.com/2006/05/finally-there-show-and-hide-fields.html
function getUserRoles( userId)
{
try
{
var command = new RemoteCommand("UserManager", "GetUserRoles");
command.SetParameter("userIds", "" + userId + " ");
var oResult = command.Execute();
if (oResult.Success)
{
return oResult.ReturnValue;
}
}
catch(e)
{
alert("Error while retrieving roles.");
}
return null;
}
function userHasRole( userId, roleName, roles)
{
if ( roles == null)
roles = getUserRoles( userId);
if (roles != null)
{
// alert( result);
var oXml = new ActiveXObject("Microsoft.XMLDOM");
oXml.resolveExternals = false;
oXml.async = false;
oXml.loadXML( roles);
roleNode = oXml.selectSingleNode("/roles/role[name='" + roleName + "']");
// alert( "roleNode = " + roleNode );
if (roleNode != null)
{
// if (roleNode.selectSingleNode("roleid[@checked='true']") != null)
if (roleNode.selectSingleNode("roleid") != null)
return true;
}
}
return false;
}
function getUserData()
{
var xml = "" +
"" +
"" +
GenerateAuthenticationHeader() +
"" +
"" +
"" +
"systemuser " +
"" +
"" +
"businessunitid " +
"firstname " +
"fullname " +
"lastname " +
"organizationid " +
"systemuserid " +
" " +
" " +
"false " +
"" +
"And " +
"" +
"" +
"systemuserid " +
"EqualUserId " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
"";
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);
var resultXml = xmlHttpRequest.responseXML;
var entityNode = resultXml.selectSingleNode("//RetrieveMultipleResult/BusinessEntities/BusinessEntity");
var firstNameNode = entityNode.selectSingleNode("q1:firstname");
var lastNameNode = entityNode.selectSingleNode("q1:lastname");
var fullNameNode = entityNode.selectSingleNode("q1:fullname");
var systemUserIdNode = entityNode.selectSingleNode("q1:systemuserid");
var businessUnitIdNode = entityNode.selectSingleNode("q1:businessunitid");
var organizationIdNode = entityNode.selectSingleNode("q1:organizationid");
var result = new Object;
result.firstName = (firstNameNode == null) ? null : firstNameNode.text;
result.lastName = (lastNameNode == null) ? null : lastNameNode.text;
result.fullName = ( fullNameNode == null) ? null : fullNameNode.text;
result.userId = (systemUserIdNode == null) ? null : systemUserIdNode.text;
result.unitId = (businessUnitIdNode == null) ? null : businessUnitIdNode.text;
result.organizationId = (organizationIdNode == null) ? null : organizationIdNode.text;
return result;
}
Bill Owens : http://billoncrmtech.blogspot.com/2008/07/client-side-scripting-retrieving.html
Ronald Lehman : http://ronaldlemmen.blogspot.com/2006/05/finally-there-show-and-hide-fields.html
function getUserRoles( userId)
{
try
{
var command = new RemoteCommand("UserManager", "GetUserRoles");
command.SetParameter("userIds", "
var oResult = command.Execute();
if (oResult.Success)
{
return oResult.ReturnValue;
}
}
catch(e)
{
alert("Error while retrieving roles.");
}
return null;
}
function userHasRole( userId, roleName, roles)
{
if ( roles == null)
roles = getUserRoles( userId);
if (roles != null)
{
// alert( result);
var oXml = new ActiveXObject("Microsoft.XMLDOM");
oXml.resolveExternals = false;
oXml.async = false;
oXml.loadXML( roles);
roleNode = oXml.selectSingleNode("/roles/role[name='" + roleName + "']");
// alert( "roleNode = " + roleNode );
if (roleNode != null)
{
// if (roleNode.selectSingleNode("roleid[@checked='true']") != null)
if (roleNode.selectSingleNode("roleid") != null)
return true;
}
}
return false;
}
function getUserData()
{
var xml = "" +
"" +
"
GenerateAuthenticationHeader() +
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"";
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);
var resultXml = xmlHttpRequest.responseXML;
var entityNode = resultXml.selectSingleNode("//RetrieveMultipleResult/BusinessEntities/BusinessEntity");
var firstNameNode = entityNode.selectSingleNode("q1:firstname");
var lastNameNode = entityNode.selectSingleNode("q1:lastname");
var fullNameNode = entityNode.selectSingleNode("q1:fullname");
var systemUserIdNode = entityNode.selectSingleNode("q1:systemuserid");
var businessUnitIdNode = entityNode.selectSingleNode("q1:businessunitid");
var organizationIdNode = entityNode.selectSingleNode("q1:organizationid");
var result = new Object;
result.firstName = (firstNameNode == null) ? null : firstNameNode.text;
result.lastName = (lastNameNode == null) ? null : lastNameNode.text;
result.fullName = ( fullNameNode == null) ? null : fullNameNode.text;
result.userId = (systemUserIdNode == null) ? null : systemUserIdNode.text;
result.unitId = (businessUnitIdNode == null) ? null : businessUnitIdNode.text;
result.organizationId = (organizationIdNode == null) ? null : organizationIdNode.text;
return result;
}
Sunday, October 5, 2008
CRM and SQL Execution
Accessing a SQL Database from a Microsoft Dynamics CRM Plug-in. Shows also how to impersonate users in SQL using "EXECTE AS LOGIN=" command.
CRM and Reporting services
How it Works: SQL Server Reporting Services and Dynamics CRM
http://blogs.msdn.com/crm/archive/2008/07/18/how-it-works-sql-server-reporting-services-and-dynamics-crm.aspx
http://blogs.msdn.com/crm/archive/2008/07/18/how-it-works-sql-server-reporting-services-and-dynamics-crm.aspx
CRM Screen casts
Microsoft Dynamics CRM Interviews and Screencasts from July 2008
Microsoft Dynamics CRM Online Video Gallery from July 2008
Microsoft Dynamics CRM Online Video Gallery from July 2008
CRM and Instant Messaging
Tracking Instant Message Conversations in Microsoft Dynamics CRM, using MS Office Communicator.
Saturday, October 4, 2008
Handling Effects of Using AsyncOperation in CRM
Post on Managing size of AsyncOperationBase table in CRM 4.0.
http://blogs.msdn.com/crm/archive/2008/07/29/managing-size-of-asyncoperationbase-table-in-crm-4-0.aspx
http://blogs.msdn.com/crm/archive/2008/07/29/managing-size-of-asyncoperationbase-table-in-crm-4-0.aspx
Videos on CRM joint with and other MS products
Created by Girish Raja and Ben Riga.
http://blogs.msdn.com/crm/archive/2008/08/18/the-dynamics-duo-dynamics-super-heroes.aspx
http://blogs.msdn.com/crm/archive/2008/08/18/the-dynamics-duo-dynamics-super-heroes.aspx
Explanation on Excel Pivot Table uning Reports in CRM
The explanation includes adding the excel file to the reports in the CRM and integrating them into the CRM environment.
http://blogs.msdn.com/crm/archive/2008/09/26/simplified-pivot-table-integration.aspx
http://blogs.msdn.com/crm/archive/2008/09/26/simplified-pivot-table-integration.aspx
Explanation on CRM import by Sonoma
Sonoma blog entry : Known issues and related support articles for Outlook client in CRM 4.0
http://blog.sonomapartners.com/2008/03/using-the-nativ.html
http://blog.sonomapartners.com/2008/03/using-the-nativ.html
Sonoma partners detailed Recent Known issues and related support articles for Outlook client in CRM 4.0
Known issues and related support articles for Outlook client in CRM 4.0
http://blog.sonomapartners.com/2008/06/known-issues-an.html
http://blog.sonomapartners.com/2008/06/known-issues-an.html
Thursday, August 21, 2008
Wednesday, August 20, 2008
Tuesday, August 19, 2008
Sunday, February 17, 2008
Plugin Registration Tool 2.0
Plugin registration tool can be fond here:
http://code.msdn.microsoft.com/crmplugin/Release/ProjectReleases.aspx?ReleaseId=90
http://code.msdn.microsoft.com/crmplugin/Release/ProjectReleases.aspx?ReleaseId=90
Saturday, February 16, 2008
CRM downloads
all recent downloads :
http://rc.crm.dynamics.com/rc/regcont/en_us/op/articles/downloads.aspx
Microsoft Dynamics CRM 4.0 Demonstration Tools :
http://blogs.msdn.com/mscrmfreak/archive/2008/02/04/available-microsoft-dynamics-crm-4-0-demonstration-tools.aspx
download the tool here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=634508DC-1762-40D6-B745-B3BDE05D7012&displaylang=en
Demonstration tool:
http://download.microsoft.com/download/1/5/7/1577a806-a5dd-4f4b-9f48-791dc86c09da/MSDYCRM40_Demonstration%20Tools.exe
http://rc.crm.dynamics.com/rc/regcont/en_us/op/articles/downloads.aspx
Microsoft Dynamics CRM 4.0 Demonstration Tools :
http://blogs.msdn.com/mscrmfreak/archive/2008/02/04/available-microsoft-dynamics-crm-4-0-demonstration-tools.aspx
download the tool here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=634508DC-1762-40D6-B745-B3BDE05D7012&displaylang=en
Demonstration tool:
http://download.microsoft.com/download/1/5/7/1577a806-a5dd-4f4b-9f48-791dc86c09da/MSDYCRM40_Demonstration%20Tools.exe
Problem when activating a Language pack
A Workaround for failure in MUI Provisioning. After installing the language pack and trying to activate the language in the system, you get an error and the event in event viewer is telling this error :
MUI Provisioning failed. Error: Cannot insert duplicate key row in object 'dbo.LocalizedLabel' with unique index 'ndx_LocalizedLabel_ForSingleSelect'.
The statement has been terminated.
the solution is to execute the statement in the organization MSCRM database:
DELETE FROM MetadataSchema.LocalizedLabel WHERE customizationlevel = 2
It seems that the problem was submitted to MS support and there should be a hotfix.
this is taken from these post :
http://blogs.msdn.com/mscrmfreak/archive/2008/02/02/mui-provisioning-failed-workaround.aspx
http://blogs.msdn.com/mscrmfreak/archive/2008/01/10/available-dutch-language-pack-for-microsoft-dynamics-crm-4-0.aspx#7379061 ( look in the comments)
MUI Provisioning failed. Error: Cannot insert duplicate key row in object 'dbo.LocalizedLabel' with unique index 'ndx_LocalizedLabel_ForSingleSelect'.
The statement has been terminated.
the solution is to execute the statement in the organization MSCRM database:
DELETE FROM MetadataSchema.LocalizedLabel WHERE customizationlevel = 2
It seems that the problem was submitted to MS support and there should be a hotfix.
this is taken from these post :
http://blogs.msdn.com/mscrmfreak/archive/2008/02/02/mui-provisioning-failed-workaround.aspx
http://blogs.msdn.com/mscrmfreak/archive/2008/01/10/available-dutch-language-pack-for-microsoft-dynamics-crm-4-0.aspx#7379061 ( look in the comments)
Wednesday, February 6, 2008
Disabling IIS Loopback Check
An Article that describes the procedure :
Error message when you try to access a server locally by using its FQDN or its CNAME alias after you install Windows Server 2003 Service Pack 1: "Access denied" or "No network provider accepted the given network path"
http://support.microsoft.com/kb/926642
Error message when you try to access a server locally by using its FQDN or its CNAME alias after you install Windows Server 2003 Service Pack 1: "Access denied" or "No network provider accepted the given network path"
http://support.microsoft.com/kb/926642
Saturday, February 2, 2008
Using CLR Integration in SQL Server 2005
Enabling CLR on sql server 2005 command :
EXEC sp_configure @configname = ’clr enabled’, @configvalue = 1
RECONFIGURE WITH OVERRIDE
Discussion on CLR Integration in SQL Server 2005 benefits and alternatives
http://msdn2.microsoft.com/en-us/library/ms345136.aspx
An Intro to CLR Integration in SQL Server 2005 By Sahil Malik
http://www.developer.com/net/net/article.php/3528601
Simple SQL CLR Integration By Amit Anajwala : Simple how to for begginers
http://www.sqlservercentral.com/articles/Development/simplesqlclrintegration/2023/
Using CLR Integration in SQL 05 for Writing Stored Procedures By Jesse Smith.
http://www.informit.com/articles/article.aspx?p=715008
Series of articles on developer.com By Sahil Malik
1. Writing Database Objects in CLR
http://www.developer.com/net/net/article.php/3548331
2. Writing Database Objects in CLR: Advanced Scenarios
http://www.developer.com/net/net/article.php/3550341
3. Solving the Mysteries of SQLCLR and System.Transactions
http://www.developer.com/net/net/article.php/3556571
EXEC sp_configure @configname = ’clr enabled’, @configvalue = 1
RECONFIGURE WITH OVERRIDE
Discussion on CLR Integration in SQL Server 2005 benefits and alternatives
http://msdn2.microsoft.com/en-us/library/ms345136.aspx
An Intro to CLR Integration in SQL Server 2005 By Sahil Malik
http://www.developer.com/net/net/article.php/3528601
Simple SQL CLR Integration By Amit Anajwala : Simple how to for begginers
http://www.sqlservercentral.com/articles/Development/simplesqlclrintegration/2023/
Using CLR Integration in SQL 05 for Writing Stored Procedures By Jesse Smith.
http://www.informit.com/articles/article.aspx?p=715008
Series of articles on developer.com By Sahil Malik
1. Writing Database Objects in CLR
http://www.developer.com/net/net/article.php/3548331
2. Writing Database Objects in CLR: Advanced Scenarios
http://www.developer.com/net/net/article.php/3550341
3. Solving the Mysteries of SQLCLR and System.Transactions
http://www.developer.com/net/net/article.php/3556571
Saturday, January 12, 2008
CRM Internet facing Deployment problems
Check this blog. The poster had some problems and fixed them using database settings.
The main fix is to set the server FQDN name in the database.
http://www.sharepointy.com/Lists/Categories/Category.aspx?Name=CRM%204%2e0
The main fix is to set the server FQDN name in the database.
http://www.sharepointy.com/Lists/Categories/Category.aspx?Name=CRM%204%2e0
CRM Queue Gadget
Gadget that monitors a user Queue in CRM
created by Akezyt and hase a link to source on getDotNet
http://blogs.msdn.com/akezyt/archive/2007/08/03/crm-queue-gadget.aspx
created by Akezyt and hase a link to source on getDotNet
http://blogs.msdn.com/akezyt/archive/2007/08/03/crm-queue-gadget.aspx
Wednesday, January 2, 2008
Compatibility for xml office documents for office 2003
Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats
http://www.microsoft.com/downloads/details.aspx?FamilyId=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en
http://www.microsoft.com/downloads/details.aspx?FamilyId=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en
Tuesday, January 1, 2008
SQL 2005 service pack details
KB article on the service pack is here :
http://support.microsoft.com/kb/941450
http://support.microsoft.com/kb/941450
Subscribe to:
Comments (Atom)