Dynamics Search Engine

Showing posts with label TFS. Show all posts
Showing posts with label TFS. Show all posts

Tuesday, March 1, 2016

How to resolve TFS error appears because of client computer name change


This article may answer your following questions.
  • How to resolve TFS error comes because of client computer name change?
  • How to fix TFS workspace error appears because of computer name or system name change?
  • How to fix the error “Workspace YourWorkspaceName; your name does not reside on this computer. If this computer was recently renamed, the workspace may be updated by running ‘tf workspaces/updateComputerName:oldComputerName’?

I was using a VM (WMware) where TFS was connected with workspace. At a certain point of time I had to change the computer name of my VM. For TFS it’s a client computer where Dynamics AX is installed. I didn’t realize that it will throw error because of computer name change. The error looks like as shown below.


Why this happens? When we configure our workspace in Visual Studio (VS) within VS or from Dynamics AX, VS stores the client computer name.

What is the workaround?

Option 1:

If you know in advance that TFS will throw error if client computer name has changed in that case follow the steps below:

1)      Go to Visual Studio (VS) and remove the workspace manually.

2)      Change the client computer name.

3)      Go to VS and create a workspace for your client computer with the new name.

Option 2:

If you are not aware of this issue that client computer name change will not work with your existing VS workspace in that case follow the steps below:

1)      Open the command prompt with run as administrator.

2)      Run the command “tf workspaces /updateComputerName:MyOldComputerName /s:[TFS URL]

Collection: [Use TFS Collection path e.g. tfsSysName.Domain.Com\TFS01]
The above command will replace the old client computer name with new one.





Leave your comments/feedback if this information was useful.

Friday, April 11, 2014

How to fix synchronization error ‘Cannot create a record in Version control changes (SysVersionControlTmpChange)’ with TFS while importing?

How to fix synchronization error ‘Cannot create a record in Version control changes (SysVersionControlTmpChange)’ with TFS while importing?

Applied on: Dynamics AX 2012 R2
Prerequisite: Basic Dynamics AX 2012 programming knowledge & basic knowledge of how to use Team Foundation Server (TFS).
Target audience: AX programmers
Assumption: You are familiar with Dynamics AX 2012, TFS and Visual Studio .Net

 
Symptom:

1)     When you try to synchronize a model with Team Foundation Server (TFS), it throws error like “Cannot create a record in Version control changes (SysVersionControlTmpChange). Change Number: [a numeric number]. The record already exists.”

 
2)     You try to synchronize an object with TFS and system throws errors “Cannot create a record in Version control changes (SysVersionControlTmpChange). Change Number: [a numeric number]. The record already exists.”

 
A sample error.

 
I was facing the above error and came up with a solution as below.

The above screenshot shows a RecID “5637527359”. I searched for this RecID in SysVersionControlSynchronizeLog table record and got the record, noticed that ItemPath field of this searched record shows a value where I can see AOT path for a view called DirPartyPostalAddressView.

Then I searched SysVersionControlSynchronizeLog table for view DirPartyPostalAddressView using ItemPath field as shown below.






It shows two entries (record) for DirPartyPostalAddressView in the searched result. Here system has two entries for DirPartyPostalAddressView so during TFS synchronization it tries to create two entries to table SysVersionControlTmpChange and this table does not allow more than one entry for the same object. During 2nd entry for DirPartyPostalAddressView to SysVersionControlTmpChange, system throws error “The record already exists.”

Now I have the visibility to which object the problem is associated with. So I opened the AOT and went to view DirPartyPostalAddressView, compiled it and synchronized it with TFS. On synchronization it throws same error. Then I started looking to the customization done for this objects and came out with a conclusion that some incorrect customization was there. I fixed it and it was working perfectly.

Hope this piece of information will be useful for you.
You may write your comments below.