Tuesday, March 22, 2011

SOLVED: Connecting to Team Foundation Server 2010 (TFS 2010) from Visual Studio 2008 (VS2008)

It took two different forum posts for me to get this working, so this deserves permanent blog recognition.  The key was that Visual Studio 2008 doesn’t have a concept of TFS “Collections” so you have to help it by providing the URL to the exact collection you are connecting to.  Not sure what the URL is?  Open up the collection in VS 2010 and copy the URL property in the Collection Properties.  Here are the steps from the forum post:

To connect to TFS 2010 using VS2008, you need to install the below components in mentioned order. The Installation order is really important to make it work.

- Install Visual Studio 2008
- Install Team Explorer 2008
- Install Visual Studio 2008 SP1 (This will upgrade both VS2008 and Team Explorer 2008 to SP1)
- Install VSTS 2008 Forward Compatibility Update

As TFS2010 introduces the notion of Team Project Collections. After the installation is completed successfully, you should provide the entire URL to connect TFS2010 server.

You can express the connection string as follows:

http://<serverName>:<port>/<vdir>/<collectionName> (e.g. http://TfsServer:8080/Tfs/ProjectCollectionName )

The <vdir> is an optional path for the TFS web sites specified by the administrator during setup. By default it is “tfs”.

 

Thursday, March 10, 2011

Hiding Custom ISV.Config Buttons in CRM 4.0

I needed to hide/show my ISV.config buttons (note the ToolTip is the key here):

 <Entity name="new_myentity">  
<ToolBar>
<Button AccessKey="P" Icon="/_imgs/button_approve.ico"
ValidForCreate="1" ValidForUpdate="1"
JavaScript="ApproveApplication();">
<Titles>
<Title LCID="1033" Text="Approve" />
</Titles>
<ToolTips>
<ToolTip LCID="1033" Text="Approve"/>
</ToolTips>
</Button>
</ToolBar>
</Entity>

So I found some sources that led me to this function that I call in the Entity’s OnLoad event:

 // hide ISV buttons that don't apply

function hideISVButton(buttonTitle) {
var comps = document.getElementsByTagName('li');
for (var i = 0; i < comps.length; i++) {
if (comps[i].title == buttonTitle)
{
comps[i].style.display = "none";
break;
}
}
}

***Interesting to note about the ISV.Config JavaScript…it calls a function that is also defined in the Entity’s OnLoad…a much cleaner alternative to real JS in the ISV.Config file:

 ApproveApplication = function() {

// Your function code here

}


Wednesday, March 9, 2011

Fun with Enums: Calculate next Monday

I needed to calculate a couple of interesting dates for the Notary system.

 

Next Monday:
  DateTime.Now.AddDays(8 - (int)DateTime.Now.DayOfWeek)

The last day of the birth month, 4 years from now:
  new DateTime(DateTime.Now.Year + 4, dobDt.Month, 1).AddMonths(1).AddDays(-1);

Tuesday, March 1, 2011

Scribe Console Access Denied Error

Today I tried to create an Integration Process for a new DTS I had just finished, but every time the Console tried to access the file system I got an “Access Denied” error.  Turned out that restarting the Scribe AdminServer restored whatever permissions the Console needed.