Thursday, May 31, 2012
Make dOOdads understand SQL Datatype Date
For you that are using the dOOdads .NET architecture and are generating source based on tables that use the datatypes Date or Time and are getting Unknown in your code. Here is a simple solution to make MyGeneration create code that supports SQL data types Date and Time:
Locate your DbTargets.xml and add
<Type From="date" To="SqlDbType.Date" />
<Type From="time" To="SqlDbType.Time" />
Locate your Languages.xml and add
<Type From="date" To="DateTime" />
<Type From="time" To="TimeSpan" />
The dOOdads allready known the datatype TimeSpan so the rest is handlesd by the framework.
To add a Date in code use DateTime.TimeOfDay to get the TimeSpan
Wednesday, February 15, 2012
Error when adding a Record Center site
When adding a Record Center to a SharePoint Server installation you may see the error “Dependency feature ‘DocumentRoutingResources’ … is not Activated
The feature is a hidden feature and can not be enabled in the GUI’s
To enable this feature start the “SharePoint 2010 Management Shell” (Power Shell) located in the start menu in “Microsoft SharePoint 2010” folder.
Copy/type the following command to enable:
Enable-SPFeature -Identity "DocumentRoutingResources" -Url http://yoursiteurl
Thursday, May 26, 2011
Create a TFS Field that contains Assigned Date
The default TFS workitems does not have a field that records last “Assigned To” date. You can easily create a new field to record this date
Start by creating a new Field Definition
Create a new rule of type WHENCHANGED
Select Field System.AssignedTo
Create a new rule of type SERVERDEFAULT
Select from “clock”
The field Assigned Date is now created and will be updated when the workitem is assigned or re-assigned.
If you prefer to modify the XML directly here is the snippet:
<FIELD name="Assigned Date" refname="NTS.AssignedDate" type="DateTime" reportable="dimension">
<WHENCHANGED field="System.AssignedTo">
<SERVERDEFAULT from="clock" />
</WHENCHANGED>
</FIELD>
Tuesday, May 10, 2011
Workflow - Use url when creating a link in workflow steps
This may be obvious, but if you choose text instead of url in a link that you create in SharePoint Designer you can get an invalid link since the text version also includes the title
Ex: “http://mysite.mydom.com, Link Title”
In my case a link already existed in a SharePoint ListItem as a valid URL. But when added as a link in a mail the url got the trailing comma and title. Which in turn gave the webserver an invalid parameter.
The link that should have been:
…/wi.aspx?pcguid=d6d9eacb-0d67-4b19-ad62-626ab5cc1cf0&id=916
became
…/wi.aspx?pcguid=d6d9eacb-0d67-4b19-ad62-626ab5cc1cf0&id=916,%20Click%20to%20open%20the%20WorkItem%20in%20TFS
and the TFS Web did not like ID’s with comma and text…
Friday, May 6, 2011
Remember to modify default.aspx after enabling “Wiki Page Home Page”
When enabling this feature you are modifying the default homepage of your site. The homepage will go from …/Default.aspx to …/SitePages/Home.aspx
When users have added bookmarks using the default.aspx homepage the users will still use your old homepage.
Quickfix edit the default.aspx file using SharePoint Designer and make a redirect to the new page. Or just add a Content editor and insert a script or descriptive text to update bookmarks
Monday, April 18, 2011
Unable to restore Oracle VirtualBox virtual machine
Note: The same issue also occurs when VirtualBox is upgraded to version 4.0.6 r71416. when you try to start any virtual machine
Failed to open a session for the virtual machine <your machine> Implementation of the USB 2.0 controller not found!
Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings (VERR_NOT_FOUND).
Unknown error creating VM (VERR_NOT_FOUND).
Today this message appeared when resuming the development machine.. Oracle VirtualBox v4.04
Especially interesting because the server was paused during a windows update (Not normally something that I do, but my host ran out of resources)
This is a verified bug, and can be easily fixed!
Locate your machine xml files (In windows they are stored in C:\Users\<your username>\.VirtualBox\Machines\<your machine>
STOP VirtualBox Manager
Open the file and locate the line:
<USBController enabled="true" enabledEhci="false"/>
Set enabledEhci to false
Start VirtualBox Manager, and resume the virtual machine.
Wednesday, March 9, 2011
Keep Dropdown items attributes during async. postback
If you add custom attributes to ListItems such as color etc. the attributes are lost when a partial postback occurs. The attributes are not kept in ViewState.
One solution is to re-apply the styles when a partial postback occurs:
if (Page.IsPostBack)
{
if (ScriptManager.GetCurrent(this.Page).IsInAsyncPostBack)
{
foreach (ListItem Item in Drp_Tasks.Items)
{
if (Item.Value.Contains("WSS Task"))
Item.Attributes.Add("Style", "color:blue");
else if (Item.Value.Contains("Timesheet Task"))
Item.Attributes.Add("Style", "color:green");
}
} }
Another solution is to create a new ListItem class that keeps the attributes in ViewState.