Wednesday, February 26, 2014

Node Js in ASP.NET MVC 4 in IIS 8 Windows 8.1 - CodeProject

Node Js in ASP.NET MVC 4 in IIS 8 Windows 8.1 - CodeProject:



Another way to include Node.JS in IIS is by settings modules in an ASP.NET MVC, as suggested by lizhong huang in his article. 

Using AngularJS in an ASP.Net Application | TechEd Australia 2013 | Channel 9

Using AngularJS in an ASP.Net Application | TechEd Australia 2013 | Channel 9:



Channel9 from Australia on Angular JS and ASP.NET application.

It has an introduction with code to Angular JS

AngularJS -‏ OneDrive

AngularJS -‏ OneDrive:

Eyal Vardi presentations on AngularJS




Saturday, February 22, 2014

Code for Sending Email to Unresolved Recipients

Its All About Microsoft Dynamics Business Solutions: Dynamics CRM 2011 : C# Code for Sending Email to Unresolved Recipients: "Code for Sending Email to Unresolved Recipients"



'via Blog this'

Forward: The open source platform for custom e-commerce - with MongoDB

Forward: The open source platform for custom e-commerce - with MongoDB:



This might be a good solution to build an e-commerce site that works with many different CRM installations, since it is easy to customize. The backbone used MongoDB.

If you want to build a stand alone E-commerce site which is separated from the CRM and build interfaces for communication, you need a flexible solution to hold the different changes customized in the CRM and must be replicated to the Site.

Monday, February 17, 2014

Problem Installing CRM 2011 Email Router on an Old Server, Error : Action Microsoft.Crm.Setup.Common.Analyzer+CollectAction failed

When installing  CRM2011 Email router I got and Error saying  "Action Microsoft.Crm.Setup.Common.Analyzer+CollectAction failed".
I retried the installation and got the same thing.

Fast search on Dr. Google pointed me to the solution:
The problem arises from registry settings left in the system from the CRM 4.0 Email router application.
After the uninstall, not all references to the installed files were deleted from the Registry and you need to manually delete these. Not very hard, but since there are lots of registry settings, remember to use the find menu option ( CTRL+F)
The information is noted by Microsoft in this Knowledge Base artice :
http://support.microsoft.com/kb/2607018

here is what they said to do:
1. execute RegEdit.exe
2. find registry settings:
• HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Currentversion\Installer\Folders
• HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\AA525E7FC7F524344B2B2650A4C6D64D 




use find option for AA525E7FC7F524344B2B2650A4C6D64D to make it easier.
Delete any reference to “C:\Program Files\Microsoft CRM Email”. DO NOT Delete anything else, since there are references there to the CRM Server if it is installed on this machine too.


3. find folder  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\68944CFD44299A6449C12100DDA86EE.
use find on "68944CFD44299A6449C12100DDA86EE8".

4. After deleting what is needed, the article says to boot the machine. unthinkable and ofcourse not needed. I had the Email Router installation program standing on the error with "retry" active, I click the "retry" button and the installation continued without the error.

Assembly Binding, no need to use Fuslogvw.exe

I had a problem deploying a windows service to a customer server. of course, at my servers, everything works great but not there.
The problem was a DLL that did not load and the service would not start.

I searched around how to log the binding of the Dlls and found the references to the  Fuslogvw.exe. I did not find the file where it was supposed to be because on a server you do not install by default the full SDK of .Net.   I thought that may be the application is not needed and looked some more and found this excellent "Back to the Basics article" by Scott Hanselman :
http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx

you need to set two registry settings:
First set the output directory on this string value : HKLM\Software\Microsoft\Fusion\LogPath
second, turn fusion on  by setting DWORD value to 1 : HKLM\Software\Microsoft\Fusion\ForceLog
Be careful with this.
After settings the ForceLog to 1, perform the operation, I had to start the service, then check the intended path for the file. They are generated immediately.
Then you can set the ForceLog calue back to 0.

You get two directories: "Default" and "NativeImage". the log files are created in both directories. I opened both directories and some problem in the native directory did not log in the Native directory, So I focused on the Default Directory.
Under the above directories I got a directory for the Application I tried to check and it had an Xml file for each Dll and they opened by the browser and are easy to read.
After reading the files I located the problematic Dlls and managed to load them.

Anyway, Even after the services did start., I got  no errors from the service and it did not write to the windows event log or the application log. So I checked again and the service would start but it did not load all the Objects it was suppose to load so it did nothing. Great.
I Checked the fusion files again until I found all the problematic references and fixed them.

The problem : For a reason I still need to check, after recompiling the projects manually, I got different Dll files with different sizes. After manually deleting the output bin directory and compiling the service again, I deployed the system again and It worked.

Tuesday, February 11, 2014

Customize a Path Gradient on Winform Paint

http://msdn.microsoft.com/en-us/library/7fswd1t7%28v=vs.110%29.aspx

Started using pomodairo - Pomodoro application built with Adobe AIR

https://code.google.com/p/pomodairo/

After using Pomodoro on my Phone, I thought to check an app that runs on my PC.
I need a task list with it to summarize what was done and did not find an easy to use app for android.

I found a recommendation that I liked here  and downloaded the application.
http://www.makeuseof.com/tag/3-free-pomodoro-productivity-apps/

After working with it for a day, the screens are to small and the app is simply not convenient.
I am going to write my own app.


Monday, February 10, 2014

Pomodoro Application, Tired of the ones I found

I think I am going to write a pomodoro application which will run as a widget. I hve a good one on my phone which I really recormmend, called ClockWork Tomato. it lacks some things I want, like writing Tasks and pausing the clock.

Here is a list of blogs on analog clocks :
http://www.codeproject.com/Articles/138452/An-Analog-Clock-Design-Using-OpenTK-in-Csharp
http://www.c-sharpcorner.com/UploadFile/mgold/VirtualClock09282005072736AM/VirtualClock.aspx
http://blog.csharphelper.com/2011/10/21/draw-an-analog-clock-in-c.aspx
http://www.c-sharpcorner.com/UploadFile/mihai.popescu/AnalogClockWidget12072006042319AM/AnalogClockWidget.aspx

Message on Form Load : Principal user (Id=, type=8) is missing prvReadContact privilege

At one of the Sites that uses Orek CRM, A user is a field employee and as such he/she do not need to have access to Customer Information. The user is managing Tasks and We Support this scenario by copying the customer relevant information to the Task itself.



Today, the admin calls me and tells me there is a strange error on the computer of one of the employees that resembles the problem with the NameCtrl ActiveX control and he is sure that this is the same problem. He even checks this on his computer with the employee credentials and does not see the problem.



Because the Error, listed below, looks like an error on the server side, we checked the authroization of the user and added Read privilege to Customer and it worked. So after removing it, we check the communication on the computer using Fiddler and found the problem in the Presence service.



We then disabled the Presence setting for the whole system and it worked. Since other users are using the Presence to chat with each other, we will need to find a solution.

The User does have Attach and Attach to privileges and I guess the real solution is to remove them from his.

The post will be updated.



The full Error :



Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Principal user (Id=55d8854b-80dc-e011-baae-0022649937c2, type=8) is missing prvReadContact privilege (Id=ba09ec92-12c4-4312-ba16-5715c2cbd6da)Detail:

<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">

  <ErrorCode>-2147220960</ErrorCode>

  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">

    <KeyValuePairOfstringanyType>

      <d2p1:key>CallStack</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">   at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)

   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)

   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)</d2p1:value>

    </KeyValuePairOfstringanyType>

  </ErrorDetails>

  <Message>Principal user (Id=XXXXXXXXXXXXXXXXXXXXX type=8) is missing prvReadContact privilege (Id=ba09ec92-12c4-4312-ba16-5715c2cbd6da)</Message>

  <Timestamp>2014-02-10T09:28:09.3875348Z</Timestamp>

  <InnerFault i:nil="true" />

  <TraceText i:nil="true" />

</OrganizationServiceFault>

Viewing all CRM Privileges, including hidden Privileges - Microsoft Dynamics CRM Team Blog - Site Home - MSDN Blogs

Viewing all CRM Privileges, including hidden Privileges - Microsoft Dynamics CRM Team Blog - Site Home - MSDN Blogs: "Viewing all CRM Privileges, including hidden Privileges"



A post by  David Jennaway about CRM Pivilegaes. It is about CRM 4.0 and I guess it can work on newer versions. I will try this with one of the customers on CRM 2011 and update this post.



He Lists the Privileges and even write reports to display them on your server. The reports can be found here:

http://archive.msdn.microsoft.com/CrmSecurityReports


Sunday, February 9, 2014

Incident/Case and Task ribbon is blank , problem in CRM Rollup 12 and Up

After installing rollup 12 and upwards, Customers may find that the ribbon is empty at the Edit Form for certain entitites, mostly Case/Incident and Task.
The problems comes from three reasons which can happen together or separately:
1. There is a Javascript Error on the form that stops the form load, this happens on the enabling of the form assistant, so disabling the Form Assistant will prevent the problem. This problem is seen in Firefox too. not just on IE.
2. There are other problems with the Javascript and HTML code that fails to execute. After Clearing the " Load pages in the most recent version of Internet Explorer" setting the form will load.
3. Rollup 14 installs the Activity Feed solution. If you installed it from the market before the rollup, the installation of the solution may fail.

sources :
problem 2 solution by Imagine Technology Group
http://thinketg.com/dynamics-crm-2011-ru-12-blank-ribbon-issue-resolution/ 
problem 2 solution by power objects
http://www.powerobjects.com/blog/2013/02/13/customized-case-ribbon-missing-ur-12/ 
problem 3 solution by chamara iresh
http://stackoverflow.com/questions/19462988/crm-2011-ribbon-bar-missing-after-applying-update-rollup-14-in-ie-not-the-chrome

Microsoft Dynamics CRM Compatibility List and Internet Explorer 11

Microsoft hase a Compatibility List of products that Microsoft Dynamics CRM support.
http://support.microsoft.com/kb/2669061

To our surprise, after the rollups that support Chrome and Firefox that work great, The CRM product dos not support Internet Explorer 11.

This is like, after all the promises that microsoft made to support HTML standard in IE, comes a team at Microsoft and declares that the Microsoft product is incompatible with theHTML standard?  After loading pages in IE 11 we see that the system is loading ActiveX controls and the IE 11 does not allow them to be created. I thought that Chrome did the same thing, so what is going on here?      Since MS is not supporting it, I saw no reason to pursue this matter.

Anyway, We had a customer that insisted on working with IE11 we tried it.
setting compatibility mode and clearing the "Load Pages with the latest IE version" settings made the system work without problems, even in an WebBrowser control inside a WinForm Application.

Tuesday, February 4, 2014

CRM 2011 Integration with SharePoint: Custom Document Management | CRM Consultancy Blog

CRM 2011 Integration with SharePoint: Custom Document Management | CRM Consultancy Blog:



One of the best articles I ever read. Really.



The Article is about automatic integration of CRM and Sharepoint using Plugin.

I wanted to write that, but since this it exists, I don't know if I will do that. Anyway, I implemented it differently so I may write my own version.



The integration is done using plugin that creates a SP Folder for each new record and  then adds a discussion on adding SP Content Types to records.

Bulk Creation of SharePoint Folders with Dynamics CRM

Bulk Creation of SharePoint Folders with Dynamics CRM:



Great Idea executed using old school methods.

The Important thing is the lesson you can connect to Sharepoint using disk Mapping.

Monday, February 3, 2014

Virtual Box and Hyper-V VHDX file format

VirtualBox, my favorite virtualization app, does not support VHDX file format as a file for virtual disk.
To convert the file to a VHD file, a HyperV is needed to import the content of such file to a new VHD file you can create for a new machine in VirtualBox.
I created the VHDX using Disk2VHD in order to load backup the server and load it to my main development PC, so after the load I can delete the VHDX file.

This article by Anurag Gawande explains how to do this:
http://blog.anuragg.com/2012/10/vhdx-to-vhd-conversion.html

Sunday, February 2, 2014

Problem Loading Solutions after creating fields on the target server

As usual, this si a Microsoft thing. We the developers, agree that the name of a field in a table
is its identification. We expect it to be the same in an Entity of a CRM.
Well, Some of Microsoft CRM Developers  disagree. They have an Guid as the key to the attribute from the Attribute table holding the Metadata.
If you create a field at two organizations by the same name, usually because you wanted to do a quick deployment of code and did not want or had pressure to provide a "solution" (your solution) to a problem, you have been hacked.
You can no longer load the solution because the solution loader will identify the original field and the one created manually as different fields and give an error.
You can find from the error the id of the field on the target organization and delete it.

Notifications in CRM 2011, Here is a blog article how to do it, keep in mind, it is still not supported by MS

http://rockstarbits.blogspot.co.il/2011/08/crm-2011-notification-area.html

The Joel Test: 12 Steps to Better Code

The Joel Test: 12 Steps to Better Code

by Joel Spolsky

http://www.joelonsoftware.com/articles/fog0000000043.html


Here is the test. The article lists the responses and the reasons why these point are important.

After reading this, I am sure Joel is a person that everybody will love to meet.

The Joel Test
  1. Do you use source control?
  2. Can you make a build in one step?
  3. Do you make daily builds?
  4. Do you have a bug database?
  5. Do you fix bugs before writing new code?
  6. Do you have an up-to-date schedule?
  7. Do you have a spec?
  8. Do programmers have quiet working conditions?
  9. Do you use the best tools money can buy?
  10. Do you have testers?
  11. Do new candidates write code during their interview?
  12. Do you do hallway usability testing?