Publish item and link Activity - Error publishing document

Jun 21, 2010 at 10:03 AM

Hi Ryan

Do you have any idea why running a workflow to publish a new item to a document library to another site might give the error....

Object reference not set to an instance of an object.    at MyLocalBroadband.Activities.WSS.Utilities.ColumnHelper.LookupField(SPList list, String fieldName) at MyLocalBroadband.Activities.WSS.Utilities.ColumnHelper.EnsurePublishedFromColumn(SPList li

Existing published items update ok in the published to list but we cannot publish new items.

This was all working fine before we moved the site to a new server.  The old server was running server 2003 R2 and the new server is running windows 2008.  We moved the site by using a stsadm backup and restore operation.  After restoring the site to the new server, we re-installed your solutions and re-compiled the workflows.  We also then updated all of the target URLs for the published files to point to the new sites.

It is obviously a configuration issue on our side as this was working perfectly on the other server.  If you could give us an insight as to why your publishing code could throw this error it may help us track down our configuration problem.

Thanks and regards


Jun 21, 2010 at 3:22 PM
I may have an idea here. EnsurePublishedFromColumn is used to make sure the extra column in the destination list exists, which will be used to store the url of the source item. Since you are getting an object not set in the column lookup call, it's probably couldn't get a handle to the SPList object for the destination list. Crack open your workflow in SPD and check that the URL for the destination list is set correctly. I'm guessing it still points to the location of the site before you moved it via stsadm. Although this method is called for updates as well, you wouldn't see this problem because it's using the existing URL stored in the updated item. I don't know for sure that this is your problem, but it seems to fit the symptoms and it would be an easy thing to miss. Let me know if this isn't it. -Ryan
Jun 22, 2010 at 5:37 PM

Hi Ryan

You are 100% correct.  Actually, we had updated the URL in the SPD workflow to the correct path but in so doing had deleted the actual destination document library name.  Doh!

Thanks for your quick response and help.