Workaround for the UpdateListItems issue with multi line & "Append Changes to Existing Text" setting?

Jul 5, 2012 at 12:53 AM

First, SPServices is a very helpful tool, and Thanks! for providing it to the SharePoint community!!!

We have a list within SP2010 to track field issues which has various columns including 'Status' (pick from choices) and 'Comments' (multi-line entry with "Append Changes to Existing Text" enabled).  We have reporting requirements external to SP to track the amount of time an issue has been in various 'Status' states.

We are running a SPServices script which checks each issue for 'Status' changes using GetVersionCollection.  If there has been a 'Status' change, the list of each change with date for the issue is rebuilt as a string, and the updated string is stored in a 'Status History' column for the issue using UpdateListItems for later use by the external reporting.

The undesired behavior we see is that the last update to the 'Comments' column is duplicated when a 'Status History' change is updated.  This behavior has been reported before in this forum:
http://spservices.codeplex.com/discussions/248153

and apparently by other users/applications:
http://social.technet.microsoft.com/Forums/en/sharepoint2010setup/thread/f0922392-8a93-46b9-8ae6-46402c9b155b
http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/a5cc87f8-57ba-477b-ae7f-bd4b810d3232/
http://sharepoint.stackexchange.com/questions/25704/stop-spfieldmultilinetext-from-updating-when-not-changed

We are looking for a way to avoid these duplicate entries in the 'Comments' column.  The next approach we will try is to disable "Append Changes to Existing Text" in the 'Comments' column before running the script, and then reenabling it afterwards.

Questions for the community are:
1) Has anyone been able to workaround the duplicate entries issue?
2)  If disabling the "Append Changes to Existing Text" in the 'Comments' column works, is there a way to also automate this disabling and reenabling in a SPServices script?

Thanks! again...

Coordinator
Jul 10, 2012 at 3:11 AM

Tommy:

I think what you are describing is how the "Append Changes to Existing Text" functionality has always worked - back to MOSS. Every time the item is saved, whether or not the "Append Changes to Existing Text" column has been updated, you get a new "value", though it is empty if the column didn't have anything typed in it.

Is that what you mean?

M.

Jul 12, 2012 at 1:49 PM
Marc:
 
What we see is probably the same way "Append Changes to Existing Text" functionality has always worked, except that we don't see blank entries when using UpdateListItems... we only see duplicate entries.
 
Assuming this is the same issue, is there a way to automate a workaround, maybe by disabling the "Append Changes..." before doing the UpdateListItems, and then reenabling it afterwards? I don't see an interface to the List settings in SPServices or the SP API, but maybe I am missing it.
 
Thanks!
Tommy
Jul 12, 2012 at 3:18 PM

I've experienced what you have TommyMcDaniel.  What I've always done and has seemed to work was to pass in a blank string of text when updating the item.  That way you don't get a carbon copy of the current message.  The only thing you have to deal with then is the time stamp that is automatically generated, but that's not difficult to mitigate either.

Cheers,

Matt