When adding a document (Excel) to SharePoint I get the exception: "(0x81071003): Unable to update the information in the Microsoft Office document".
The exception occur in a ItemAdded event handler where I add a global unique human-readable document id to the document.
This most likely due to an error in the property promotion/demotion part of SharePoint.
If I try to open up the Excel sheet myself I get an error as inline VBA code cannot be executed. So if SharePoint tries the same no wonder it doesn't work. But how can you block promotion/demotion in such situations.
Ideas very much appreciated.
Friday, June 29, 2007
Monday, June 11, 2007
Search Query Web Service Test Tool for Microsoft Office SharePoint Server (MOSS) 2007
If you need to work with MOSS search engine this is a must have tool.
Tuesday, June 05, 2007
Office property promotion/demotion in SharePoint
I came across this posting today about Office property promotion/demotion. Figuring out why and when properties are synchronized from SharePoint into Office and vice versa is quite a challenge. I'm still figuring out the details. Documentation and details needed.
Wednesday, May 09, 2007
SharePoint fine grained permission control
Just located this blog - an excellent description of how to extend SharePoint permissions to avoid approvers having delete rights.
Wednesday, May 02, 2007
Approve a SPFolder programmatically
If you are creating folders programmatically in SharePoint you'll notice that they turn of with "Approval Status" Pending.
Conclusion: And it's just sooo simple --> check out this.
Luckily it seems that you can programmatically change the _ModerationStatus of a folder item using the ProcessBatchData operation of the SPWeb object as outlined in this blog.
Unfortunately for me I can't get it working - yet. My code for ProcessBatchData looks like this:
<?xml version="1.0" encoding="UTF-8"?><ows:Batch OnError="Continue" >
<SetList Scope="Request">{5234ebfe-58c5-4af3-8879-cde8ade42315}</SetList>
<SetVar Name="DatesInGregorian">TRUE</SetVar>
<Method ID="1,Update">
<SetVar Name="Cmd">Save</SetVar>
<SetVar Name="ID">14</SetVar>
<SetVar Name="owshiddenversion">1</SetVar>
<SetVar Name="owsfileref">http://intranet/Projects/Labbooks/ABC</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#_ModerationStatus">0</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#_ModerationComments">Exformatics Approved Folder</SetVar>
</Method>
</ows:Batch>
I get a proper reply back - but the folder is not yet approved. Maybe it only works in SharePoint 2003 and not in MOSS 2007. However, according to Joris Poelmans ProcessBatchData also works for MOSS 2007 - at least for creating new pages.
A good description with similar syntax can be found here - but not working either :-(
Conclusion: And it's just sooo simple --> check out this.
Luckily it seems that you can programmatically change the _ModerationStatus of a folder item using the ProcessBatchData operation of the SPWeb object as outlined in this blog.
Unfortunately for me I can't get it working - yet. My code for ProcessBatchData looks like this:
<?xml version="1.0" encoding="UTF-8"?><ows:Batch OnError="Continue" >
<SetList Scope="Request">{5234ebfe-58c5-4af3-8879-cde8ade42315}</SetList>
<SetVar Name="DatesInGregorian">TRUE</SetVar>
<Method ID="1,Update">
<SetVar Name="Cmd">Save</SetVar>
<SetVar Name="ID">14</SetVar>
<SetVar Name="owshiddenversion">1</SetVar>
<SetVar Name="owsfileref">http://intranet/Projects/Labbooks/ABC</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#_ModerationStatus">0</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#_ModerationComments">Exformatics Approved Folder</SetVar>
</Method>
</ows:Batch>
I get a proper reply back - but the folder is not yet approved. Maybe it only works in SharePoint 2003 and not in MOSS 2007. However, according to Joris Poelmans ProcessBatchData also works for MOSS 2007 - at least for creating new pages.
A good description with similar syntax can be found here - but not working either :-(
Wednesday, April 25, 2007
Strange workflow error - visual studio - Error 319 (0x13F)
Using Visual Studio.NET 2005 we're trying to create a new workflow. However, we get a strange error in VS.Net 2005 as outlined below:
Error 4 Property 'WorkflowProperties' has invalid value. Field type 'Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties' does not match with the expected type 'Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties'.

Any hints, ideas etc?
Workflow error codes can be found on MSDN, but little information about how to fix them.
I also get the error as outlined below:

Could not bind property 'WorkflowProperties'
Could not load file or assembly 'Microsoft.SharePoint.Library, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
I'm also trying to update VS.Net 2005 with "Windows Workflow Foundation Extensions for Visual Studio 2005" as outlined in various guidelines. However, it seems that Microsoft has renamed the tool - at least I cannot find the latest released on MSDN. I often wonder why it has to be soooooooo difficult.
Error 4 Property 'WorkflowProperties' has invalid value. Field type 'Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties' does not match with the expected type 'Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties'.

Any hints, ideas etc?
Workflow error codes can be found on MSDN, but little information about how to fix them.
I also get the error as outlined below:

Could not bind property 'WorkflowProperties'
Could not load file or assembly 'Microsoft.SharePoint.Library, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
I'm also trying to update VS.Net 2005 with "Windows Workflow Foundation Extensions for Visual Studio 2005" as outlined in various guidelines. However, it seems that Microsoft has renamed the tool - at least I cannot find the latest released on MSDN. I often wonder why it has to be soooooooo difficult.
Saturday, April 21, 2007
Reorder properties in Document Libraries
I have tried to modify the sequence of properties in a document library and luckily I found the following excellent blog describing how to accomplish the result using the ProcessBatchData.
Sunday, April 15, 2007
Controlling MOSS Document templates
It's a pleasure to leverage others work - rather than having to re-invent the wheel myself all the time.
Ton Stegeman has written an excellent blot about how to control MOSS document templates programmatically. Thanks you.
Ton Stegeman has written an excellent blot about how to control MOSS document templates programmatically. Thanks you.
Monday, April 02, 2007
SPFieldUser with default value
Monday, March 26, 2007
SPItemEventReceiver - ItemAdded and ItemUpdated runs simultaneous
I have created a lot of event handlers over the last months, but sometimes I cannot get them working properly. From time to time it seems that item-events are running in sequence, i.e. ItemAdded then ItemUpdated. However, in other situations ItemAdded starts - but before ItemAdded finish ItemUpdated starts. I would like to ensure that one event is completed before the next is kicked off. Any hints.
It appears that is it critical to use SystemUpdate(...) rather than Update() as outlined here. But a note claims this was only an issue for beta versions?
I have tried using SystemUpdate rather than Update as sketched below, read this blog.
this.DisableEventFiring();
anItem.SystemUpdate(false);
this.EnableEventFiring();
The sequence of events is also quite strange as outlined in many blogs, try reading this.
Solution: It seems that if you ensure using SystemUpdate and Disable/Enable EventFiring as sketched above consistently in your eventhandler you don't have any issues. But I'm not yet convinced.
It appears that is it critical to use SystemUpdate(...) rather than Update() as outlined here. But a note claims this was only an issue for beta versions?
I have tried using SystemUpdate rather than Update as sketched below, read this blog.
this.DisableEventFiring();
anItem.SystemUpdate(false);
this.EnableEventFiring();
The sequence of events is also quite strange as outlined in many blogs, try reading this.
Solution: It seems that if you ensure using SystemUpdate and Disable/Enable EventFiring as sketched above consistently in your eventhandler you don't have any issues. But I'm not yet convinced.
Friday, March 23, 2007
InfoPath password field
InfoPath doesn't support a password field otu of the box. An explanation of this can be found at Microsoft, but I don't really buy this explanation as InfoPath can be used for many purposes, i.e. like editing SharePoint tasks which is an online thing tightly integrated with SharePoint.
A workaround, using a custom task pane is outlined here. Unfortuntale that will not work with MOSS workflows :-(
A custom ActiveX component might be the only solution - quite difficult to manage and setup. But it is possible to create the control is Visual Basic 6.0 as outlined here.
Other ideas very much appreciated.
It seems that I could use Visual Studio Tools for Applications (VSTA). Will elaborate more shortly...
A workaround, using a custom task pane is outlined here. Unfortuntale that will not work with MOSS workflows :-(
A custom ActiveX component might be the only solution - quite difficult to manage and setup. But it is possible to create the control is Visual Basic 6.0 as outlined here.
Other ideas very much appreciated.
It seems that I could use Visual Studio Tools for Applications (VSTA). Will elaborate more shortly...
Thursday, March 22, 2007
Custom columns not visible
Sometimes custom columns are not visible in Site Columns. The reason is the readonly flag as described here.
Saturday, March 17, 2007
SPWebEventReceiver - SiteDeleting
I have been searching for examples of SPWeb event handlers that can block the ability to delete a site/web from SharePoint as outlined here. The SPWebEventReceiver class is outlined at msdn - unfortunately without an example.
So far I have not been able to get it working - but hopefully shortly.
Ideas and input very much appreciated.
I found a good example here.
So far I have not been able to get it working - but hopefully shortly.
Ideas and input very much appreciated.
I found a good example here.
Labels:
MOSS,
Regulatory Document Management,
SharePoint
Sunday, March 11, 2007
A duplicate name "_dlc_Exempt" was found.
Any ideas what this error means?
Happens when I try to execute:
Microsoft.Office.RecordsManagement.InformationPolicy.Policy.CreatePolicy(SPContentType ct, Policy globalPolicy)
Conclusion: Believe it or not - simply ignore this error!!! The policy is created despite the exception - so catch the exception - and then continue. Excellent API.
Happens when I try to execute:
Microsoft.Office.RecordsManagement.InformationPolicy.Policy.CreatePolicy(SPContentType ct, Policy globalPolicy)
Conclusion: Believe it or not - simply ignore this error!!! The policy is created despite the exception - so catch the exception - and then continue. Excellent API.
Computed columns cannot be added to Document library
Using a feature I have added three site columns, one of which is computed. The two not-computed columns can be found under "Site Columns" in the Site Administrator window:
But what about the computed site column? The computed column is available under the site
oWeb.AvailableFields()
but doesn't show up above - neither it shows up under the Edit View (All Documents):
So - how do I add a computed field - preferably with a picture - in a view?
Further - very often Site Columns are not updated and displayed - despite an IISRESET - so they are simply not present :-(

Friday, March 09, 2007
Custom Link field in a SharePoint Document Library
I have a document library with various content types. Depending on the content type I wish to display different graphics, i.e. not just displaying the name of the content type but a graphics file instead., i.e. similar to the "URL (URL with edit menu)" field outlined below:

Depending on the version of the file I also wish to display different fields. I would like the published version of the file to be accessed from the same link always - and if a minor version exists this version should be accessed from another link in the list.
I have tried to create a feature with a custom field that contains exactly this stuff - no luck. The new custom field simply doesn't show up in my view.
I came across this blog but I couldn't get it working :-( Couldn't add an IF statement in a computed field. I got the error "The formula contains a syntax error or is not supported. " when I tried to add the IF statement. As a next step I studied the difference between Computed and Calculated fields as outlined in this blog. When I add the field as a Calculated field the above blog works - voila. However, changing fldtypes.xml is not recommended - would like to get it working using standard features. The other issue is that I would need to add this calculated field to all my document types in order to enable field selection on a view.
The issue currently is the fact that computed fields cannot easily be added to list or views - at least they don't show up if added as features. Calculated fields does.
Remember the difference between the two field types: Computed fields are not stored in the database but calculated fields are.
Further - you need to note the difference between columns, fields and properties - as described in this blog.
Still not fully understanding what is going on it seems that calculated fields are not really columns - so they cannot be viewed in the Site Columns collection (despite the fact they are added with other fields as part of the same feature). Neither - unfortunately - they cannot be added to a view.
If I look into the SPWeb object
.AvailableSiteColumns('')
my column is returned. But how can I add it to the view?
Apparently other people have had this issue too - here and here.
In SharePoint 2003 I simply modified onet.xml to accomodate this new field, as outlined here.
Depending on the version of the file I also wish to display different fields. I would like the published version of the file to be accessed from the same link always - and if a minor version exists this version should be accessed from another link in the list.
I have tried to create a feature with a custom field that contains exactly this stuff - no luck. The new custom field simply doesn't show up in my view.
I came across this blog but I couldn't get it working :-( Couldn't add an IF statement in a computed field. I got the error "The formula contains a syntax error or is not supported. " when I tried to add the IF statement. As a next step I studied the difference between Computed and Calculated fields as outlined in this blog. When I add the field as a Calculated field the above blog works - voila. However, changing fldtypes.xml is not recommended - would like to get it working using standard features. The other issue is that I would need to add this calculated field to all my document types in order to enable field selection on a view.
The issue currently is the fact that computed fields cannot easily be added to list or views - at least they don't show up if added as features. Calculated fields does.
Remember the difference between the two field types: Computed fields are not stored in the database but calculated fields are.
Further - you need to note the difference between columns, fields and properties - as described in this blog.
Still not fully understanding what is going on it seems that calculated fields are not really columns - so they cannot be viewed in the Site Columns collection (despite the fact they are added with other fields as part of the same feature). Neither - unfortunately - they cannot be added to a view.
If I look into the SPWeb object
.AvailableSiteColumns('
my column is returned. But how can I add it to the view?
Apparently other people have had this issue too - here and here.
In SharePoint 2003 I simply modified onet.xml to accomodate this new field, as outlined here.
Sunday, March 04, 2007
Modify SharePoint Content type order programmatically
In a recent blog Ton Stegeman has described how to modify the default contenttype order sequence using the UniqueContentTypeOrder property of the SPFolder object.
While the code fixes the layout for the New button it unfortunately doesn't solves the issue for Upload, as Upload uses the default content type for the document library - not for the folder :-(
Any ideas much appreciated
While the code fixes the layout for the New button it unfortunately doesn't solves the issue for Upload, as Upload uses the default content type for the document library - not for the folder :-(
Any ideas much appreciated
Thursday, March 01, 2007
InformationPolicy - content types - challenges
The excellent information policy example described by Ton Stegeman here is an excellent starting point for learning more about SharePoint 2007 Information Policies. The example given works like a dream.
However - there is a challenge that I have not yet managed to overcome. When associating the informatonpolicy with a content type within a document library it works just fine.
But when I create a site content type and then create a new document library and add the site content type (with the information policy associated) to the document library nothing works :-(
When inspecting the details it turns out that no event receivers are associated with the content type found on the document library.
I was assuming that once an information policy is associated it would be enforced in all locations. This assumption is not correct.
However - there is a challenge that I have not yet managed to overcome. When associating the informatonpolicy with a content type within a document library it works just fine.
But when I create a site content type and then create a new document library and add the site content type (with the information policy associated) to the document library nothing works :-(
When inspecting the details it turns out that no event receivers are associated with the content type found on the document library.
I was assuming that once an information policy is associated it would be enforced in all locations. This assumption is not correct.
Labels:
MOSS,
Regulatory Document Management,
SharePoint
Tuesday, February 27, 2007
Subscribe to:
Posts (Atom)