Friday, March 8, 2013

Web Deploy v2 and Web Application Packages



WebApplication.deploy.cmd -- when I run this command on my local machine I was getting this message:

To deploy this Web package, Web Deploy (msdeploy.exe) must be installed on the computer that runs the .cmd file. For information about how to install Web Deploy, see the following URL:
http://go.microsoft.com/?linkid=9278654

To install V2 of the MSDEPLOY.exe you MUST FIRST UNINSTALL V1! There is no failure message if you install V2 after V1, it just simply doesnt write the V2 files to the V2 directory if V1 is installed. Odd behaviour, but is what it is.

If this is not your issue, check out VS2010's SP1 fix to the WebApplication.deploy.cmd:
http://stackoverflow.com/questions/6595086/msdeploy-v2-doesnt-work-with-vs2010s-packages



Wednesday, March 6, 2013

CRM 2011 FYI for programmatic solution imports


The ImportSolutionRequest.PublishWorkFlows property also publishes SDKProcessingMessages! It doesnt say this in any documentation, but it does. It is explicit on a solution import through the GUI.

Tuesday, March 5, 2013

Rollup 12 Service Activity bug and Microsoft's Public Apology


Our users found an odd bug on our service activity form (where we have custom javascript to set a lookup field based on some business logic).

The error below started coming up after rollup 12. I explain steps to reproduce in more detail here:
http://stackoverflow.com/questions/14819416/bug-in-crm-service-appointment-forms-javascript-causing-form-save-error/14989557#14989557

We ended up getting an acknowledgement of the bug from Microsoft and they pushed a fix online, but will have to wait for rollup 13 for the fix on-premise. They are damaging their credibility with these bugs and I am not the only one to notice. It even prompted a public apology from Bob Stutz, a Microsoft VP. Apologies can't give me or my customers their time back.

>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #52178855: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
>   at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException)
>   at System.Guid.TryParseGuidWithNoStyle(String guidString, GuidResult& result)
>   at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
>   at System.Guid..ctor(String g)
>   at Microsoft.Crm.Application.Platform.AttributeCollection.CreateEnityReferenceFromLookupPropertyValue(String name, Object value, IOrganizationContext context)
>   at Microsoft.Crm.Application.Platform.AttributeCollection.SetEntityProperty(Entity entity, String name, String childAttributeName, Object parentProperty, AttributeMetadata attributeMetadata, Object value, IOrganizationContext context)
>   at Microsoft.Crm.Application.Platform.AttributeCollection.Insert(String name, Object value, Boolean throwIfKeyExists)
>   at Microsoft.Crm.Application.Platform.EntityProxy.SetLookupValueData(XmlNode node)
>   at Microsoft.Crm.Application.Platform.EntityProxy.SetData(XmlNode entityElement)
>   at Microsoft.Crm.Application.Platform.ApplicationEntityCollection.Deserialize(String entitiesXml, String entityType, IOrganizationContext context)
>   at Microsoft.Crm.Application.Platform.EntityProxy.SetData(XmlNode entityElement)
>   at Microsoft.Crm.Application.Forms.EndUserForm.RetrieveParametersForEventDefault()
>   at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity)
>   at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd)
>   at Microsoft.Crm.Application.Components.PageHandlers.SchedulableActivityBasePageHandler.ConfigureFormHandler()
>   at Microsoft.Crm.Application.Components.PageHandlers.ServiceAppointmentRecordPageHandler.ConfigureFormHandler()
>   at Microsoft.Crm.Application.Components.PageHandlers.RecordPageHandler.ConfigureFormWrapper()
>   at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName)
>   at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e)
>   at System.Web.UI.Control.PreRenderRecursiveInternal()
>   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>   at System.Web.UI.Page.HandleError(Exception e)
>   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>   at System.Web.UI.Page.ProcessRequest()
>   at System.Web.UI.Page.ProcessRequest(HttpContext context)
>   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
>   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Import CRM 2011 Solution Dependency Error for a Workflow



I have a workflow that creates a Case from an Opportunity. It maps fields like the title and price list and spits out a case, simple and tested in my development org. However, when I exported the unmanaged solution it resides in as managed and import that into a blank org, this error occurred:

The dependent component Attribute (Id=parentaccountid) does not exist.  Failure trying to associate it with Workflow (Id=13e950d4-8e77-e211-b5f0-080027cd26e8) as a dependency. Missing dependency lookup type = AttributeNameLookup.

Despite having the dependency (parentaccountid is a system field on the Opportunity Product entity!) in the target org. So right off the bat I know this is going to be a weird one. How can I not have a stock system field?

My own analysis looking into the XML for the workflow found one node with reference to parentaccountid for preferredserviceid. (perferredserviceid is a system field on the account). However, the workflow did not contain a reference to that preferredserviceid field! How odd. Its like CRM remembered at one point that it did have a reference to it and never removed it. That "memory" caused it to output the field as a dependency in the workflow XML but not in one of the workflow steps itself. How odd.

I attempted deleting the whole workflow and re-add it to see if that node exported in the new workflow and it did not. After deleting and painfully copying each detail from the original workflow into a new one the error was gone. Hope that helps someone else in this situation.