MS CRM Lookup


Online project management, task software, and free collaboration workspace: AJAXWorkspace
AJAXWorkspace is a free online workspace that offers task tracking software, team collaboration, online calendar, document sharing, and file management for project management and teamwork.

Here is a good reference explains how to configure MS CRM lookup field!

“As many of you already know that the CRM lookup field saves the GUID of the related entity. Let’s have a deep view of the lookup field. When you create a relationship between two entities, one entity can reference the other entity through a lookup field…”

http://jianwang.blogspot.com/2008/05/mysterious-crm-lookup-i.html

Truncate MS SQL transaction Log file


Most users always suggest to detach and re-attach DB to remove the log file when dealing with large Transaction log file. There is one proper way to truncate the transaction log file to certain size. Here are the sample steps to truncate SQL Log file:

USE AdventureWorks;
GO
– Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE AdventureWorks
SET RECOVERY SIMPLE;
GO
– Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (AdventureWorks_Log, 1);
GO
– Reset the database recovery model.
ALTER DATABASE AdventureWorks
SET RECOVERY FULL;
GO

You can find the details here: http://msdn.microsoft.com/en-us/library/ms189493.aspx

An error occurred during printing. (0×8007F303) - MS Reporting Services


Yes, it’s another bug in SSRS. One of my colleagues building a MOSS portal that integrated with SSRS. We are facing a problem when user clicks on print from ‘Action’ button. The first dialog prompted to choose the printer but when press print, the following error message pop up indicate “An error occurred during printing. (0×8007F303)”. If click preview button rather than print, a preview of blank report with the words: “An error occurred trying to render the report (0×8007f303)”. Guess what is the problem???

After hours of searching, debugging and googling, he manage to find out the root cause. This is because we did some customization on the reporting services web.config file. We remove the export “tif” file type in the reporting services web.config file. We do know why this little change is causing the big problem during printing.  Hope this helps!

Web part updatepanel not working in publishing portal – ASP.NET AJAX and SharePoint


Today, I manage to solve this problem after spending hours of googling. During the integration between ASP.NET AJAX and SharePoint, you might found that AJAX does not working in certain type of SharePoint site template.

First, AJAX does not work in publishing site without doing some modification on the master page. It works in other site template such team site. The problem is that, the webpart manager TAG inside the master page“<WebPartPages:SPWebPartManager runat=”server”/>” has been placed before the Form Tag. To resolve this issue, just cut it and paste after the Form Tag as below

Original Code
<body class=”body” onload=”_spBodyOnLoadWrapper();”>
<WebPartPages:SPWebPartManager runat=”server”/>
<form runat=”server” onsubmit=”return _spFormOnSubmitWrapper();”>

….
….
Resolved Code
<body class=”body” onload=”javascript:if (typeof(_spBodyOnLoadWrapper) != ‘undefined’) _spBodyOnLoadWrapper();”>
<form runat=”server” onsubmit=”return _spFormOnSubmitWrapper();”>
<asp:ScriptManager runat=”server” ID=”ScriptManager1″></asp:ScriptManager>
<WebPartPages:SPWebPartManager runat=”server”/>

….
….

* You might found the similar solution in other place. I do a summary and make it easier to search by users with the correct keywords.

Google Chrome - Good for user but not developer?


Google launch its new Web Browser – Chrome today. Check out here: http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html

I just curious do we need another new browser beside MS Internet explorer and Mozilla FireFox? Personally, I think the current browsers already full-fill what I need. As a web developer, we need to build our web application to support these 2 major browsers. Now, Google launch another new browser, Chrome. Although, they complied w3c and other web standards, but it always got minor differences in UI rendering. This means that we need to put in extra efforts to support another new browser. I guess it should be good news to user but more efforts for us.

403 Forbidden when access SharePoint portal site


After we ran a content deployment job we seem to have this recurring issue where hitting the SharePoint site when one is unauthorized gives the generic 403 Forbidden message. So we found ourselves having to authenticate first (by visiting a backend list or manually going to the _layouts/authenticate.aspx page to bring up the popup to get the credentials…

We don’t know why the site would not ask me to log in to begin with; instead it goes right to the 403 error…
Solution

We added read access to the application pool user on the Inetpub directory to solve this issue. This may have been lost on content deployment or some other way. However it seems to have been the root of the issue all along.

* Thanks to Alexander who share out this issue.

Redirecting User on ItemAdding in SharePoint EventHanlders


Here is an issue from my colleague.

The problem

We got a custom list for which handling ItemAdding Event, in the ItemAdding Event (We are creating a site). We are trying to redirect user to a custom site page, the redirection works fine but the item doesn’t gets added to the list at the same time the site gets created.  On ItemAdded, we are trying the redirection code but HttpContext is null

The Solution

The reason why our item isn’t added is when its redirect, the current thread is aborted and the item is never added to the list. We will have to manually add the item.
HttpContext is null in the ItemAdded because this event is asynchronous – The HttpContext is only available within the constructor when a synchronous event is fired.

The following article explains the same problem and provides a details solution:
http://www.entwicklungsgedanken.de/2008/03/27/redirecting-from-newformaspx-to-dispformaspx-after-creating-a-new-item/

* Thanks to Elin and Akhilesh!

Feature and Content Type to create a web part page library


Here are one good scenario and solution on Feature and Content Type to create a web part page library from my colleague.

The problem

The goal of this exercise is to have a document library act as a store for web part pages and for the “New document” button to create a web part page with my custom content type’s attributes.

Here’s the content type:

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
<ContentType
ID=”0×010109010097431DDCD27A4eedA052535AA74AD98A”
Name=”Content Zone Page Template”
Group=”CMS Content Types”
Description=”Content type for Content Zone Page Templates”
>
<FieldRefs>
<FieldRef ID=”{29B7EF45-7669-4572-A42A-823559212C15}”
Name=”cmsDisplayName”
Required =”TRUE”
/>

</FieldRefs>
</ContentType>

<ContentTypeBinding
ContentTypeId=”0×010109010097431DDCD27A4eedA052535AA74AD98A”
ListUrl=”ContentZoneTemplates”
/>
</Elements>

And the List Instance:

<ListInstance
FeatureId=”00BFEA71-E717-4E80-AA17-D0C71B360101″
Id=”3001″
TemplateType=”101″
Title=”Content Zone Templates”
Url=”ContentZoneTemplates”
Description =”CMS Base: Content Zone Templates”
DocumentTemplate=”106″
/>

Now, I’ve tried the list instance without a document template, but that makes the default “new” item a template.doc.  Using the document template as “106″ brings up a file called “_webpartpage.htm” but asks if you want to open it rather than just opening it.

The default behavior if you create a document library and set it’s content type to web part page (all through the UI) is that it first opens that _webpartpage.htm file which then redirects to the spcf.aspx page, but with knowledge of which document library you came from.

The Solution

In the content type definition, add a document template element pointing to the new web part page form.  So, it looks like this now (the addition for the solution is highlighted in yellow):

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
<ContentType
ID=”0×010109010097431DDCD27A4eedA052535AA74AD98A”
Name=”Content Zone Page Template”
Group=” CMS Content Types”
Description=”Content type for Content Zone Page Templates”
>
<FieldRefs>
<FieldRef ID=”{29B7EF45-7669-4572-A42A-823559212C15}”
Name=”cmsDisplayName”
Required =”TRUE”
/>

</FieldRefs>
<DocumentTemplate TargetName=”/_layouts/spcf.aspx” />

</ContentType>

<ContentTypeBinding
ContentTypeId=”0×010109010097431DDCD27A4eedA052535AA74AD98A”
ListUrl=”ContentZoneTemplates”
/>
</Elements>

* Thanks to Jesicca who share out this KB.

Change OsCommerce category to Tree View


First, I am new to OsCommerce and php programming (yes, a MS guy here). Recently, I am helping my friend to setup a web store using OsCommerce.  Frankly, OsCommerce is a well-known open source web store. I don’t think I need to talk much here. When come to customization, I come across one requirement; change left category to a TreeView. I try to search on google but found nothing. But some post did mentioned OsCommerce itself already support treeview structure. We just need to change categories.php in “os\catalog\includes\boxes” to make it look like a treeview. Here is the outcome after some customization.

How to change it?

1.    Download this source (zip) file and upload “treeview” folder into “os\catalog\images” folder.
2.    Upload “categories.php” to replace the file in “os\catalog\includes\boxes”.

Hope this can benefit to anyone who need this features. Do let me know it got any bugs!

Central Administration is not working- Error File Not Found


Central Administration is not working. When I access central administration, I received the “File Not Found. Troubleshoot issues with Windows SharePoint Services.”  message after I entered my credentials.
Checked the IIS, and the Application Pools for Central Administration as well Central Administration were started. Everything looks fine.  The content web site is working fine. Only the central administration is down.

From what I get from my colleague, in a lot of cases, the easiest way to resolve this issue is to reprovision CA. In other words, unprovision the CA using the config wizard or psconfig.exe and the reprovision it again using the same tools. (This is not the same as disconnect from the farm and if done correctly, will not affect the production of the regular sites).

* This issue happened on one of my colleague and thanks to Jukka who provide this solution.