$().SPServices.UpdateListItems not updating list item

Aug 20, 2013 at 3:01 AM
I am attempting to provide my users with the ability to save edits made to a list item editform and continue working without needing to reopen the edit form.

I have the following function linked to the click event of a button on a customised edititem.aspx form:
$().SPServices({
        operation: "UpdateListItems",
        async: false,
        batchCmd: "Update",
        listName: "Manage Recruitment Process Tasks",
        ID: $myID,
        valuepairs: [["Advertisement_x0020_Date", $adDate.val()]],
        completefunc: function(xData, Status) {
            alert(xData.responseText);
        }
    })
Something is amiss, as edit to the value in the required column (in this example) is not saved.

It's only going to be something simple, I know, but for the life of me I cannot spot it.

For info, $adDate.val() variable is set to '19/08/2013'. Is this the problem? Wrong date format for updating a date field, perhaps?

The response text returned is:
ows_Title="Advertise vacancy for Administrator at Ashburton branch" ows_Predecessors="" ows_Priority="(2) Normal" ows_Status="Not Started" ows_PercentComplete="0" ows_AssignedTo="29;#Group HR Manager" ows_DueDate="2013-08-24 20:56:27" ows_Checkmark="boolean;#0" ows_RelatedItems="[{"ItemId":58,"WebId":"e80f57da-5b0a-4701-801e-b5c77971c0b5","ListId":"848e80b2-de9b-45e7-96c5-afb79a3a5155"}]" ows_PreviouslyAssignedTo="" ows_WF4InstanceId="bcf51f84-aafc-41a6-8761-ca0d4f625345" ows_Generic_x0020_Task_x0020_Outcome="In Progress" ows_RecruitmentListItemID="58" ows_RecListProvJobTitle="Administrator" ows_RecBranch="Ashburton" ows_RecProcessStage="placead" ows_Description_x0020_of_x0020_Dutie="This that and teh other" ows_Pay_x0020_Basis="Salary" ows_Contracted_x0020_Hours="40.0000000000000" ows_RecListBranchID="1" ows_Actual_x0020_Job_x0020_Title="Administrator" ows_New_x0020_Employee_x0020_Details="No" ows_v_Assigned_x0020_To="Group HR Manager" ows_ID="244" ows_ContentType="Generic Task" ows_Modified="2013-08-19 20:56:41" ows_Created="2013-08-19 20:56:36" ows_Author="9;#Simon Marling" ows_Editor="9;#Simon Marling" ows_owshiddenversion="3" ows_WorkflowVersion="1" ows__UIVersion="512" ows__UIVersionString="1.0" ows_Attachments="0" ows__ModerationStatus="0" ows_LinkTitleNoMenu="Advertise vacancy for Administrator at Ashburton branch" ows_LinkTitle="Advertise vacancy for Administrator at Ashburton branch" ows_LinkTitle2="Advertise vacancy for Administrator at Ashburton branch" ows_SelectTitle="244" ows_Order="24400.0000000000" ows_GUID="{01C1AB68-4A32-497C-82D0-8FC512291C4D}" ows_FileRef="244;#sites/dev/Lists/Manage Recruitment Process Tasks/244_.000" ows_FileDirRef="244;#sites/dev/Lists/Manage Recruitment Process Tasks" ows_Last_x0020_Modified="244;#2013-08-19 20:56:36" ows_Created_x0020_Date="244;#2013-08-19 20:56:36" ows_FSObjType="244;#0" ows_SortBehavior="244;#0" ows_PermMask="0x7fffffffffffffff" ows_FileLeafRef="244;#244_.000" ows_UniqueId="244;#{0A2A66C0-E008-4E6D-BC64-0D007FACCCA0}" ows_ProgId="244;#" ows_ScopeId="244;#{49B5E2F9-C14C-437C-9984-0BA4D7BF07A9}" ows__EditMenuTableStart="244_.000" ows__EditMenuTableStart2="244" ows__EditMenuTableEnd="244" ows_LinkFilenameNoMenu="244_.000" ows_LinkFilename="244_.000" ows_LinkFilename2="244_.000" ows_ServerUrl="/sites/dev/Lists/Manage Recruitment Process Tasks/244_.000" ows_EncodedAbsUrl="https://mysite.sharepoint.com/sites/dev/Lists/Manage%20Recruitment%20Process%20Tasks/244_.000" ows_BaseName="244_" ows_MetaInfo="244;#" ows__Level="1" ows__IsCurrentVersion="1" ows_ItemChildCount="244;#0" ows_FolderChildCount="244;#0" ows_AppAuthor="2;#Workflow" ows_AppEditor="2;#Workflow" xmlns:z="#RowsetSchema" /></Result></Results></UpdateListItemsResult></UpdateListItemsResponse></soap:Body></soap:Envelope>
Aug 20, 2013 at 3:10 AM
I'm pretty sure it's the date format. When using WebServices the date must be formatted as YYYY-MM-DD.
_____
Paul

Sent from mobile device.

Aug 23, 2013 at 3:20 AM
Hi Paul,

You were virtually on the money with your recommendation.

For the record, I was able to get SharePoint to accept the date in the following format - "YYYY-MM-DDTHH:mm:ss Z" - using the moment.js lib, i.e.
$appCloseDateformatted = moment($appCloseDate.val(), 'DD-MM-YYYY').format();
Coordinator
Aug 30, 2013 at 8:58 PM
Yes, the date has to be in the ISO format. You can also use the SPServices function SPConvertDateToISO.
https://spservices.codeplex.com/wikipage?title=$().SPServices.SPConvertDateToISO

M.