Saturday 27 September 2014

HMRC RTI database - deleting an unwanted submission

If like me you have got an outstanding submission in the HMRC Basic PAYE tools and it shouldn't be there and there is no way to delete it; then you may have to edit the SQLLite database that it uses. Here are the steps I undertook:

1. Backup the data from within the Basic PAYE tools application.

2. Download the SQLLite tool from here: http://sqlitebrowser.org (the source code can be downloaded here). This will allow you to view and edit the underlying database.

3. Open the sqllite.db in %appdata%\Roaming\HMRC\payetools-rti

4. Look in the bptrti_submissiondirtydata table. You'll see one row that looks like the outstanding submission. Find the "id" column and note down the number for the row.

5. Execute
delete from bptrti_submissiondirtydata where id = <id>
and substitute <id> with the appropriate ID that you took note of in step 4.

Tuesday 16 September 2014

Code Analysis not working properly through MSBuild

One project would not build locally on my machine through an MSBuild script, despite it working in Visual Studio.

The error was various permutations of the FxCop error:

InfoMessageExtensions.cs(19): error : CA1006 :
Consider a design where 'InfoMessageExtensions.InfoMessageFor<TModel, TProperty>(this HtmlHelper<TMo
n<Func<TModel, TProperty>>, object)' doesn't nest generic type 'Expression<Func<TModel, TProperty>>'.

 
An inspection of what was going on was that:
1.      MSBuild (v4) was picking up old versions of FxCop
2.      The Code Analysis suppression was not being taken into account

 
Issue 1 was fixed by installing VS2012. There are better ways to sort this by defining the Microsoft.CodeAnalysis.Targets in the project or as command-line parameters to MSBuild.

Issue 2 was the killer. This is a BUG in Visual Studio. For the code analysis and suppressions to work with MSBuild, the Conditional Compilation symbol CODE_ANALYSIS must be added to the project file (VS.NET doesn’t need it but MSBUILD does).
 

 
However the bug is this: If ONE symbol is present, the symbol is not written to the Csproj. After adding a dummy symbol it then appeared. See below for the before and after.
 
 
 

Then MSBuild works.

Monday 15 September 2014

MSMQ explorer

MSMQ QExplorer is a good tool for viewing MSQM messages.

http://sourceforge.net/p/msmqqxplorer/code/HEAD/tarball?path=/QXplorer%202.0

Changing the OneNote screen clipping / capture shortcut

For OneNote 2007, see Changing the OneNote Screen Clipping and New Side Note keyboard shortcuts. I believe this article will answer your question.
In short, look at this registry key:
 HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\OneNote\Options\Other
There are two DWORD values ScreenClippingShortcutKey & NewNoteShortcutKey. The default values are:
  • ScreenClippingShortcutKey: 0x53
  • NewNoteShortcutKey: 0x4e
If we look in this ASCII table:
In row 5, column 3 (0x53), we see the S. So, this is where the S of the hotkey is set.
Change it to another value according to the ASCII table to adjust the hotkey.

Wednesday 10 September 2014

ZoomIt - Error launching 64-bit version: This program is blocked by your group policy.

Zoomit doesn't work on a 64-bit machine with certain group policy settings.
In my situation, when you run the downloaded zoomit.exe, it tries to create a 64-bit version in the folder specified by the TEMP variable. Writing to the specific temp folder is blocked by group policy.

So the solution was to create a new folder C:\Temp1 and change the TEMP variable to C:\Temp1  - this fixed the problem.