When trying to write an event log, sometime we hit the error "Requested registry access is not allowed."
It's due to permission on registry entry for event log.
Solution:
1. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog.
2. Right-click Eventlog, and then click Permissions.
3. Add Everyone and give Full Control permission.
Search
Thursday, October 7, 2010
Wednesday, September 29, 2010
Update - Microsoft Certification
Yeah just finished my second CRM exam as MCTS and received my MCP ID & Access Code (been delayed for a week due to Iverson's admin key in my email as "jhotmail.com").
Spent some time to work on my virtual business card. I like the avatar actually, pretty cool where it took in Cherating valentine trip :).
Cool??
2 exam down and 2 more to go.
Targeted to complete the rest within 2month to achieve my MCITP - Developer for Microsoft Dynamics CRM 4.0.
Stay update.........
Updated :
Got my another cert on 29 October 2010.
3 down and 1 more to go...
Spent some time to work on my virtual business card. I like the avatar actually, pretty cool where it took in Cherating valentine trip :).
Cool??
2 exam down and 2 more to go.
Targeted to complete the rest within 2month to achieve my MCITP - Developer for Microsoft Dynamics CRM 4.0.
Stay update.........
Updated :
Got my another cert on 29 October 2010.
3 down and 1 more to go...
Friday, August 27, 2010
Share Reassigned Records with Original Owner
In the Settings --> Administration --> System Settings window, right on the General Tab. There is a section marked as "Set whether reassigned records are shared with the original owner". You can then choose whether or not to share reassigned records with the original owner.
What this does is any time you reassign a record it will share the record with the previous owner. Not just the original creator, but every owner after.
Note : This will not undo anything that is already shared, but it will stop the system from sharing anything more if you don't want it to.
What this does is any time you reassign a record it will share the record with the previous owner. Not just the original creator, but every owner after.
Note : This will not undo anything that is already shared, but it will stop the system from sharing anything more if you don't want it to.
Friday, July 2, 2010
Sorting custom entities for security roles in CRM
We are busy with a huge crm implementation and currently have about 100 custom entities.
When we started to look at the security matrix for the system and it became a nightmare to set the privileges on the security roles as CRM does not sort the custom entities alphabetically.
I found a solution where add sorting to custom entities tab in security roles.
Locate the file called edit.aspx located at:
\Program Files\Microsoft Dynamics CRM\CRMWeb\Biz\Roles\edit.aspx
Add the following code in bottom of the page:
Note:
When we started to look at the security matrix for the system and it became a nightmare to set the privileges on the security roles as CRM does not sort the custom entities alphabetically.
I found a solution where add sorting to custom entities tab in security roles.
Locate the file called edit.aspx located at:
\Program Files\Microsoft Dynamics CRM\CRMWeb\Biz\Roles\edit.aspx
Add the following code in bottom of the page:
<script type="text/javascript">
var tbl = document.getElementById('tab7').children(0).children(0).children(0).children(0).children(0);
var x = [];
for (var i = 0; i < tbl.rows.length; i++)
x[i] = [tbl.rows[i].cells[0].innerHTML,tbl.rows[i].outerHTML];
var str = x[0][1];
for (var i = 1; i < x.length - 1; i++)
for (var j = i + 1; j < x.length; j++)
if (x[i][0] > x[j][0]) {//sort by alphabet
var tmp = x[j];
x[j] = x[i];
x[i] = tmp;
}
for (var i = 1; i < x.length; i++) {
var rows = x[i][1];
if ((i % 2) != 0) {//background color for odd number rows
if (rows.indexOf('<TR class=on>') > -1) {
rows = rows.replace('<TR class=on>', '<TR>');
}
}
else {//background color for even number rows
if (rows.indexOf('<TR class=on>') < 0) {
if (rows.substring(3, 5) == 'TR') {
rows = rows.replace(rows.substring(3, 5), 'TR class=on');
}
}
}
str += rows;
}
document.getElementById('tab7').children(0).children(0).children(0).children(0).innerHTML = '<TABLE class=ms-crm-Form-Area onmouseover=SetAltText(); ondblclick=ProcessClick(); onclick=ProcessClick(); cellSpacing=0 cellPadding=2><COL><COL width=70><COL width=70><COL width=70><COL width=70><COL width=70><COL width=70><COL width=70><COL width=70>'+ str + '</table>';
</script>
Note:
- This is unsupported. Please do backup before editing.
Friday, May 21, 2010
Collapsable CRM section
attachCollapsableToSections();
function getElementsByCondition(condition, container) {
container = container || document;
var all = container.all || container.getElementsByTagName('*');
var arr = [];
for (var k = 0; k < all.length; k++) {
var elm = all[k];
if (condition(elm, k)) arr[arr.length] = elm;
} return arr;
}
function attachCollapsableToSections() {
var sections = getElementsByCondition(function(elm) {
if (elm.className.indexOf("ms-crm-Form-Section") != -1)
return true;
}, null);
for (var i = 0; i < sections.length; i++) {
sections[i].innerHTML = '<img id="' + i + '_imgid" src="/_imgs/navup.gif" alt="Expanded, click to collapse" style="cursor:hand;"/> <label id="' + i + '_lblid" />' + sections[i].innerHTML;
sections[i].childNodes[0].attachEvent('onclick', toggleVisibility);
sections[i].childNodes[2].attachEvent('onclick', toggleVisibility);
}
}
function toggleVisibility(e) {
var sectionContainer = e.srcElement.parentNode.parentNode.parentNode;
var elements = getElementsByCondition(function(elm) {
if (elm.vAlign == "top") return true;
}, sectionContainer);
for (var i = 0; i < elements.length; i++) {
if (elements[i].style.display == "none") {
elements[i].style.display = "";
if (e.srcElement.id.indexOf("_lblid") != -1) {
var _imgid;
_imgid = e.srcElement.id.replace(/(^\d+)(.+$)/i, '$1') + "_imgid";
document.getElementById(_imgid).src = document.getElementById(_imgid).src.replace("navdown", "navup");
}
else {
e.srcElement.src = e.srcElement.src.replace("navdown", "navup");
}
} else {
elements[i].style.display = "none";
if (e.srcElement.id.indexOf("_lblid") != -1) {
var _imgid;
_imgid = e.srcElement.id.replace(/(^\d+)(.+$)/i, '$1') + "_imgid";
document.getElementById(_imgid).src = document.getElementById(_imgid).src.replace("navup", "navdown");
}
else {
e.srcElement.src = e.srcElement.src.replace("navup", "navdown");
}
}
}
}
Tuesday, May 11, 2010
LINQ on CRM SDK 4.0.12
- Download here.
- Generate linq code for CRM, from a command line – go to the SDK folder/Microsoft.xrm/Tools and run the following command line – replacing MyCrmServer with your actual server name, replace MyCrmOrg with your actual CRM Org and MyEntitiesFolder with the name. Note : This assumes using integrated authentication for on-premise – support is available for many different scenarios – check the docs.
crmsvcutil /connectionString:"Authentication Type=AD; Server=http://servername/crm_orgname; User ID=domain\username; Password=password;" /out:"C:\Entities"
I’m very excited to talk about the new LINQ to CRM libraries available recently. Say you need to retrieve an Account Number, given the Account Name…
Using the traditional webservice methods:
ColumnSet cols = new ColumnSet();
cols.AddColumns(new string[] {"accountnumber"});
QueryByAttribute query = new QueryByAttribute();
query.ColumnSet = cols;
query.EntityName = "account";
query.Attributes = new string[] {"name"};
query.Values = new string[] {"Microsoft Dynamics CRM"};
RetrieveMultipleRequest req = new RetrieveMultipleRequest();
req.Query = query;
req.ReturnDynamicEntities = true;
RetrieveMultipleResponse resp = oService.Execute(req) as RetrieveMultipleResponse;
BusinessEntityCollection becMultipleRecords = resp.BusinessEntityCollection;
if (deSalesOrder.Properties.Contains("accountnumber"))
{
//And So On
//And So Forth
}
Using LINQ to SQL:
var accounts = (from a in context.Accounts
where a.Name.Equals("Microsoft Dynamics CRM")
select a).ToList();
LINQ2CRM.Account acc = (Account)accounts.First();
Response.Write("Account name = " + acc.Name.ToString());
Friday, May 7, 2010
CRM 4.0 & .NET 4.0
For those that have had a chance to play with Visual Studio 2010 RC and .NET 4.0, you may have considered the possibility of writing CRM 4.0 extensions with this new framework. Unfortunately, this is not to be.
So what’s the problem exactly? The big jump is that Microsoft .NET 4.0 actually ships with a new version of the Common Language Runtime (CLR). It’s a bit confusing, but .NET 3.0 and .NET 3.5 actually used the .NET 2.0 CLR. This is because .NET 3.0 and 3.5 were really just a set of extensions to the framework and did not require an actual new runtime. This means that ASP.NET 2.x to 3.5 all used the same .NET 2.0 runtime! As such, Microsoft CRM 4.0 has no problem working with extensions that use the .NET 2.0 CLR, and takes advantage of framework extensions found in .NET 3.0 and 3.5.
So whether you run an in process plug-in or an asynchronous one, if you try to write a plug-in that uses the .NET 4.0 CLR you will get an error that looks something like this:
Microsoft.Crm.CrmException: Assembly cannot be loaded from C:\Program Files\Microsoft Dynamics CRM Server\server\bin\assembly\testing.dll. ---> System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files\Microsoft Dynamics CRM Server\server\bin\assembly\testing.dll' or one of its dependencies.
This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
For web pages/custom pages,
In theory, if you could get the CRM web site to run under ASP.NET 4.0, this would get around this error. However I am sure plenty of other things would break and this doesn’t help with plug-ins hosted by the Outlook client or the Asynchronous Service.
If you want to use .NET 4.0 with CRM 4.0, you are not entirely out of luck. As long as it runs in its own process space, either on the client (like a Silverlight 4.0 control) or on another web site (like an IFRAME or a pop-up dialog from a CRM form), things should work.
The good news of course is that Microsoft CRM 5.0 will be written take full advantage of .NET 4.0, WF 4.0 and more.
So what’s the problem exactly? The big jump is that Microsoft .NET 4.0 actually ships with a new version of the Common Language Runtime (CLR). It’s a bit confusing, but .NET 3.0 and .NET 3.5 actually used the .NET 2.0 CLR. This is because .NET 3.0 and 3.5 were really just a set of extensions to the framework and did not require an actual new runtime. This means that ASP.NET 2.x to 3.5 all used the same .NET 2.0 runtime! As such, Microsoft CRM 4.0 has no problem working with extensions that use the .NET 2.0 CLR, and takes advantage of framework extensions found in .NET 3.0 and 3.5.
So whether you run an in process plug-in or an asynchronous one, if you try to write a plug-in that uses the .NET 4.0 CLR you will get an error that looks something like this:
Microsoft.Crm.CrmException: Assembly cannot be loaded from C:\Program Files\Microsoft Dynamics CRM Server\server\bin\assembly\testing.dll. ---> System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files\Microsoft Dynamics CRM Server\server\bin\assembly\testing.dll' or one of its dependencies.
This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
For web pages/custom pages,
In theory, if you could get the CRM web site to run under ASP.NET 4.0, this would get around this error. However I am sure plenty of other things would break and this doesn’t help with plug-ins hosted by the Outlook client or the Asynchronous Service.
If you want to use .NET 4.0 with CRM 4.0, you are not entirely out of luck. As long as it runs in its own process space, either on the client (like a Silverlight 4.0 control) or on another web site (like an IFRAME or a pop-up dialog from a CRM form), things should work.
The good news of course is that Microsoft CRM 5.0 will be written take full advantage of .NET 4.0, WF 4.0 and more.
Subscribe to:
Posts (Atom)