Tuesday, April 20, 2010

Files missing in SharePoint? Even from RecycleBin and (god forbids) AllUserData?

If files are disappearing from your SharePoint Document Library and you are (probably) using some custom code on SharePoint Doc Libs then check if you have any SPFile.Delete() call because if so, that row will disappear from SharePoint for ever...Unless you have you Backup/Restore working on.

Developers should be aware that there is another method, .Recycle() that will send the file to the RecycleBin, and this is safer in most cases. Of couse if RecycleBin is disabled this method doesn't add any value i guess...

There are other cases that will delete the file for ever like sp workflow deletions but im not aware of more...probably those that internally use Delete().

There are some nice posts with more info on this @ sharemypoint, and its also good to read the SPFile documentation ;)

Tuesday, January 12, 2010

A new challenge(company) for 2010!

Thats right, I'm starting 2010 at a new company, ANCP. I have great memories from my former company, DevScope, and i will always remeber it has a great place to work, always at the tip of the edge adopting new technologies, young and smart people working on new stuff that most people on the country haven't heard about, even those working on IT.

I just want to say thanks to everyone at DevScope, specially Luis Martins for the opportunity and Marco Silva with who i have been working more regularly in the past year ;)

Now I will be focusing on SharePoint, and start to learn a BPM tool for SharePoint, but because i have moved to a non-IT company i will be giving support to other stuff as well. It's a different point of view that, I hope, will give me a different perspective to my work and insight to the business. Also because it's a government agency i might not be exposing everything i will be doing, still, expect some more SharePoint stuff, and more. Wish me luck @ ANCP.

Thursday, December 3, 2009

Language "pt-PT" does not exist in this MessageManager instance

Hi,

We were having some problems with the Variation site of a Commerce 2009 Contemporary Site. It seems when errors happen the message doesnt get translated. These things happen for example when searching and presenting orders in Order History. In the root or en-US site they work ok. In MOSS logs we didnt find much information.

We have most of the functionality working on the pt variation but these 'errors' were stoping us from advancing.

We get something like this in event log:
Pipeline Error: Component Execution failed for component[0x9] hr: 0x1B5AA390 ProgID: Commerce.OrderDiscount.1 Language "pt-PT" does not exist in this MessageManager instance. And something like this: An exception of type 'System.Runtime.InteropServices.COMException' occurred and was caught.
-------------------------------------------------------------------------------------------
12/02/2009 15:19:14 Type : System.Runtime.InteropServices.COMException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Component Execution failed for component[0x9] hr: 0x1B5AA390 ProgID: Commerce.OrderDiscount.1 Language "pt-PT" does not exist in this MessageManager instance. Source : Commerce.MtsPipeline

We solved it by creating a MessageManager Resource dll, all info here: http://msdn.microsoft.com/en-us/library/ms964360(CS.70).aspx

You can find rc.xml in commerce sdk, RCxml2resx in commerce tools, resgen and al in visual studio command prompt.

We lost some time with this, and this solved almost all our problems, it should be documented in the variations paper ;)

Wednesday, November 18, 2009

Commerce Server 2009 + Windows 2008 R2 + Alias

If you get a strange error running Sharepoint Comerce Server Wizard at unpacking or having problems running PUP.exe and have an ALIAS configured for Sql, try adding the alias to the hosts file. This solved some problems. It seems PUP.exe uses named pipes to access Sql, go figure..

An error has occurred (80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.



Thursday, November 12, 2009

.NET 3.5 SP1 missing when installing Commerce Server 2009 on Win 2008 R2

When you try to install Commerce Server 2009 (after the 2007 install) on a Windows Server 2008 R2 you will get an error saying to install .NET 3.5 SP1.

You may try to install it, but you cant, when you try to install it extracts and the installer vanishes...you know why? R2 already comes with 3.5 SP1 (a warning on the installer saying its already installed would give us a better clue)

After some poking around we found a MS hot fix...a reg key is missing on the 3.5 SP1 of the R2.


Please stay around for more CS2009 info and also check my colleague Marco's Silva blog, for it will have soon more CS2009 goddies ;)

Wednesday, November 11, 2009

Annoying error Saving Page Content, and Compatibility View


There are some annoying things while we work, Saving Page Content is one of them:



Its easy to get rid of: Advanced Settings, disable "Enable native XMLHTTP support".


Another thing i didnt understand was i didnt had compability view enabled in IE8 and i didnt understand why, here are the reasons:

Sometimes the Compatibility View button isn’t displayed. The button is located on the address bar next to the ‘stop’ and ‘refresh’ buttons. There are a few cases where there’s no action for a user take and, thus, the Compatibility View button will not show:
  • If you're viewing an internal-to-Internet Explorer page (such as about:InPrivate)
  • If you're viewing a page that has declared it's "ready" for Internet Explorer 8 through use of the versioning tag / HTTP header (it doesn’t matter if this tag triggers Quirks, IE7 Standards, or IE8 Standards, the button won’t be displayed)
  • If you're viewing an intranet page and you have the ‘Display intranet sites in Compatibility View’ checkbox selected
  • If you're viewing any webpage and you have the ‘Display all websites in Compatibility View’ checkbox selected
  • If you're viewing a webpage that is included on the Microsoft-supplied compatibility view updates list and you have the ‘Include updated website lists from Microsoft’ checkbox selected
  • If you've toggled either the ‘Document Mode’ or ‘Browser Mode’ settings via the Developer Toolbar

Thursday, October 22, 2009

Extensions

Just found out about a nice feature unknowed by me atleast...Extensions!

Just create something like:

public static class Extensions
{
bool MYMETHOD(this int value)
{
return whatever;
}

This will cause an extension to the int32 class, so in every int you will be able to call MYMETHOD, like this:

int n = 4;
if(n.MYMETHOD())
do something;

Maybe alot of you already know this but i didnt...pretty usefull.