Tuesday, 28 October 2014

SharePoint 2010 :- 'Activate Features'. A timeout has occurred while invoking commands in SharePoint host process.

When trying to deploy a SharePoint project getting Error Message:
Error occurred in deployment step 'Activate Features'. A timeout has occurred while invoking commands in SharePoint host process.

After doing a bit of search found every second article was saying to specify the time in the key

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\SharePointTools key, and then add a time out to 'ChannelOperationTimeout' to something like 240 for 4 mins time out.

but the issue I was getting in my system I only had path up to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0

Resolution

Open Regedit
go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0
Create a new Key (folder) SharePointTools
Create a DWORD entry called ChannelOperationTimeout
Specify the value of 480

I used the 480 as the project I was trying to deploy actually took 06.14 mins

Wednesday, 24 September 2014

Ribbon button display issue

I was involved in the issue of finding why one of the ribbon button R1 was not shown when deployed at client environment, after checking the entity ribbon diff xml everything looked fine, I started investigating into the database side of it.

After investigation I found that there was an old solution1 which used to refer the same entity but at that time the ribbon button which should be shown was not included in it.
Later on it was decided the correct place for the entity is solution2 and a new ribbon button R1was added on it afterward and entity was removed from solution1.

Theory says the ribbon xml should be merged instead of overwritten, but actually what's happening is the last one wins, so I updated installation instruction document to re-import soution2 when solution1 is deployed to make sure ribbon button appears correctly. This could be due to same publisher is in use for both solution1 and solution2.

Other option.
As any managed change deployed can not be removed from the system unless the managed solution which installed it is uninstalled but doing this would cause the import data to be deleted. one option we could use is to create a new solution3 with the same publisher for solution1 with the changes we like to keep in the system and then after installation of the solution3 uninstall solution1 doing this will keep the entities, records in the system as referred by solution3, but will take any change no longer required i.e. entity with R1, this would cause the deletion of any layers/records defined in the database due to solution1 initial import.

but the reason we didn't got with this option and stick for the installation instruction to re-import is the level of risk involved in uninstallation.

Thursday, 4 September 2014

Permission denied - javascript prompt

In development environment when trying to make ajax call using the ActiveX object post request was getting following error

Permission denied.


Resolution

Add the website the request is made to trusted site along with the one the site is making the request.

if the dialog is disabled due to enforced policies, use the following register key and delete it and then reopen the browser, this will let you add site to trusted area


HKLM\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings

Reduce the trust security to low

(before making any change to register please take a backup, and to reduce the trusted security level you should know the implication).

This is not in any shape the desired solution and should be avoided if possible.

Monday, 1 September 2014

getting the related view values from the lookup field

 
 
 

returns the  schema name of the field1
Xrm.Page.getAttribute("new_customAttribute").getValue[0].values[0].name

returns the  value of the field1
Xrm.Page.getAttribute("new_customAttribute").getValue[0].values[0].value


 returns the schema name of field2
Xrm.Page.getAttribute("new_customAttribute").getValue[0].values[1].name

returns the value of the field2
Xrm.Page.getAttribute("new_customAttribute").getValue[0].values[1].value

Wednesday, 27 August 2014

After installing Rollup 16/17, i started getting Syntax Error (it happens on RU 12+)

I upgraded my crm 2011 org from Rollup 5 to 16/17. After installing rollup when I try to refresh page or close page,  I started getting following error

Microsoft Dynamics CRM Error Report Contents
<CrmScriptErrorReport>
  <ReportVersion>1.0</ReportVersion>
  <ScriptErrorDetails>
   <Message>Syntax error</Message>
   <Line>1</Line>
   <URL>/userdefined/edit.aspx?etc=10083&id=%7bD659C33F-2C2D-E411-A69D-00155DC1050C%7d&pagemode=iframe</URL>
   <PageURL>/userdefined/edit.aspx?etc=10083&id=%7bD659C33F-2C2D-E411-A69D-00155DC1050C%7d&pagemode=iframe</PageURL>
   <Function></Function>
   <CallStack>
   </CallStack>
  </ScriptErrorDetails>
  <ClientInformation>
   <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.3; .NET4.0E; .NET4.0C)</BrowserUserAgent>
   <BrowserLanguage>en-US</BrowserLanguage>
   <SystemLanguage>en-US</SystemLanguage>
   <UserLanguage>en-GB</UserLanguage>
   <ScreenResolution>1829x1029</ScreenResolution>
   <ClientName>Web</ClientName>
   <ClientTime>2014-08-27T13:47:55</ClientTime>
  </ClientInformation>
  <ServerInformation>
    <OrgLanguage>1033</OrgLanguage>
    <OrgCulture>1033</OrgCulture>
    <UserLanguage>1033</UserLanguage>
    <UserCulture>1033</UserCulture>
    <OrgID>{6D7D42E2-F413-E411-B524-00155DC1050C}</OrgID>
    <UserID>{8594944A-FE13-E411-B524-00155DC1050C}</UserID>
    <CRMVersion>5.0.9690.4156</CRMVersion>
  </ServerInformation>
</CrmScriptErrorReport>

When I press F12 to see the error in IE developer tool it shows

edit.aspx?etc=....
<!DOCTYPE HTML PULBIC "..//W3C//DTD HTML 4.0 Transitional//EN">
<!DOCTYPE html PUBLIC "" ""><HTML>...



After doing bit of search I found out that this has started happening after Rollup 12+

Resolution:
Make sure all the javscript libraries are starting with the $webresource: prefix



http://dynam1cscrm.wordpress.com/2013/03/25/visual-ribbon-editor-calling-javascript-function-syntax-error-after-upgraded-to-crm-2011-rollup-12/

Tuesday, 26 August 2014

After installing RU 16 and then 17, one of the working webservice stopped working

We have a webservice  which was built using 32 bit dll and is used within crm, for that purpose we created a new application pool to run for .net 4 but to allow 32 bit application to run.
This was working fine, however

After RU 16 and 17 were installed, I started getting error

"HTTP Error 500.0 - Internal Server Error

Calling LoadLibraryEx on ISAPI filter "c:\Program Files\Microsoft Dynamics CRM\Server\bin\DefaultAddonFilter.dll" failed
...
Handler: ExtensionlessUrl-Integrated-4.0

"

Resolution:

1. Copy the "Microsoft.Crm.Core.dll" to the bin folder of webservice
2. Go to the app pool and click on "Advance Settings..." specified in the Actions properties area and set the 'Enable 32-Bit Applications" to False.
3. Add the node <clear/> in the configuration/system.web/httpModules node
<httpModules>
   <clear />
</httpModules>
4. Add the following section in the configuration/system.webServer/handlers node as below
<handlers>
     
<clear/>
     
<add name="svc-Integrated-4.0" path="*.svc" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" preCondition="integratedMode" />

<add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" resourceType="Unspecified" preCondition="integratedMode" />

</handlers>







http://ms-crm-2011-beta.blogspot.co.uk/2011_09_01_archive.html

Friday, 22 August 2014

After UR16 and 17, import solution process hangs

After UR16 and 17 when I try to import solution the progress bar shows 0 progress even after 15 mins, even if i have a pretty small solution file.

I tried repair CRM ... no luck
Tried IE 8,9 and 10 still no luck

looked into database using following query and no record is shown as created.

selectsolutionname,progress, startedon, completedon from importjob(nolock) order by startedon desc

----
By running trace log got following error

[2014-08-22 10:23:18.896] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:   15 |Category: Exception |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 60faee5d-965c-4002-ac92-b398190d2694 | CrmException..ctor  ilOffset = 0x36
 at CrmException..ctor(Int32 errorCode, Object[] arguments)  ilOffset = 0x36
 at SolutionImportProcessPage.ProcessRequestData()  ilOffset = 0x4A
 at SolutionImportProcessPage.ProcessAction(String action)  ilOffset = 0x92
 at AppUIPage.OnPreRender(EventArgs e)  ilOffset = 0xD
 at Control.PreRenderRecursiveInternal()  ilOffset = 0x54
 at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  ilOffset = 0x69E
 at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  ilOffset = 0x3C
 at Page.ProcessRequest()  ilOffset = 0x14
 at Page.ProcessRequest(HttpContext context)  ilOffset = 0x31
 at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()  ilOffset = 0x11D
 at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  ilOffset = 0x15
 at ApplicationStepManager.ResumeSteps(Exception error)  ilOffset = 0x10E
 at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)  ilOffset = 0x5C
 at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)  ilOffset = 0xFC
 at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)  ilOffset = 0x45
>Crm Exception: Message: An error occurred while importing a Solution., ErrorCode: -2147188685


Resolution:

Download the CRM 2011 SDK from microsoft website http://www.microsoft.com/en-gb/download/details.aspx?id=24004

Stop the Async Service

- Open Visual Studio Command Prompt in administrator mode and run following command

 gacutil -i "C:\SDK\Bin\Microsoft.Crm.Sdk.Proxy.dll"

- IISReset

- Restart Microsoft Dynamics Aync services

http://www.abhinavranjan.net/blog/2013/05/import-solution-issue-in-ur-12/