Sharepoint Online - Update task list items - sharepoint

We are having issues with updating task lists in Sharepoint Online.
Process is:
We have a Sharepoint Online site with a task list in it (compatible list with MS Project).
We have a web application (PHP) from which we call Sharepoint Web services to update fields in that task list.
Our issue is the update itself.
We get no error from the WS Sharepoint, which reply synchronously with the concerned item (but not updated).
Here is the SOAP envelope we send:
<SOAP-ENV:Envelopexmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/">
<SOAP-ENV:Body>
<UpdateListItemsxmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>EMU200601SIM</listName>
<updates>
<BatchListVersion="1"OnError="Continue">
<MethodCmd="Update"ID="1">
<FieldName="afacturerdebut">30</Field>
<FieldName="afacturerfin0">70</Field>
<FieldName="ID">1773</Field>
</Method>
</Batch>
</updates>
</UpdateListItems>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here are the headers :
Content-Type: text/xml;
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems";
Version control is not activated on the task list.
Reading the tasklist works fine but updating it does not work: fields of the item are not updated.
I've tried changing the list name, field name, and I think everything is well configured cause I don't have any error.
It's weird Sharepoint WS does reply with the item but does not execute the UpdateListItems operation.
Did someone successfully update a tasklist by calling Sharepoint Online WS?

I finally found my mistake: Sharepoint column names and case.
You need to provide exactly the same letter case for the column names in order to update an item in a list.
It could be nice from Microsoft to have an error code for "unknown column" instead of no error at all...

Related

SharePoint 2013 on-prem Add-In EmailAssignTo on task list

I've created a Task List in my app web with a custom content type based on task. I want to be have an email sent when an item is assigned to someone.
Looking around it seems that adding EmailAssignTo="TRUE" to the List element in Schema.xml should do the trick however I see the following:
Warning 1 The 'EmailAssignTo' attribute is not declared.
EmailAssignTo doesn't seem to be documented by Microsoft. Am I going about this the wrong way?
Based on a quick PowerShell check/test the List property you want appears to be entitled EnableAssignToEmail, which expects a Boolean value.
Source documentation from MSDN:
https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.enableassigntoemail.aspx
SPList.EnableAssignToEmail property
Gets or sets a Boolean value specifying whether e-mail notification is enabled for the list.

Sharepoint 2010 workflow task custom content type

I'm trying to create workflow(state machine) with particular content type task, and receiving "An error has occurred in [workflow name] " error in workflow history, which is absolutely no informative, in this case I have no idea what happened and where is my mistake.
More details :
I have created VS project for task with custom content type and its forms, and deployed it.
I have created VS project for state machine workflow.
in the Elements.xml set up TaskListContentTypeId
My Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow
Name="Pre-Award Approval Workflow"
Description="Pre-Award Approval Workflow"
Id="33ad7f25-b86f-43e8-86d8-300e92891227"
CodeBesideClass="Pre_Award_Approval_Worflow.Workflow.Workflow"
TaskListContentTypeId="0x0100d7d89499b9234bde9a67bfb11db5ce64"
CodeBesideAssembly="$assemblyname$">
<Categories/>
<MetaData>
<AssociationCategories>List</AssociationCategories>
<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
</MetaData>
</Workflow>
</Elements>
The workflow adjusted on new item create event.
When I create a new item of my list I received error on workflow history "An error has occurred in [workflow name] "
To find in which step error has occurred I set up before and after each workflow step LogToHistoryListActivity and found out that error occurred in createTask , but when I try-catched whole crteateTask_Invoking function there is no exception occured.
When I took away TaskListContentTypeId="0x0100d7d89499b9234bde9a67bfb11db5ce64" from Element.xml there is no error, but workflow created task with default content type which is no good for me.
Where is my mistake?
I will be happy even if anybody can give me advice in which way I should investigate.
Thanks in advance.
After more deeply digging in this issue I found the best solution where well described this topic. It is a book - SharePoint 2010 as a Development Platform - 2010, particularly in Chapter -16 subject Deploying Workflows. I hope its will help for someone.
Problem with the code
The problem is that the content type starting with 0x0100 is not a valid option for the workflow option TaskListContentTypeId.
Solution
To make a workflow use a non-default content type for workflow tasks the content type must inherit from the default Task list content type. The resulting content type ID starts with 0x010801.
So in your Elements.xml you should have
TaskListContentTypeId="0x010801....."
More information in the book "SharePoint 2010 as a Development Platform" (pp. 947-1034) by Joerg Krause et al, 2010.
Credits
Jamal Ulb for asking this interesting question and sharing his testresults leading to the answer you are reading now.

Sharepoint Designer 2013: Workflow stops when current item is a Lookup Field

Objective: Create a Workflow that Rename a Document in the Library.
My Document Library is in a sub site, is a child. This library have two lookup columns, and they refer to a list in the main site, the parent. That is, a library that have lookup field a list in other site. These lookup field, I will use to rename a file.
Problem: in my worflow every action that use [%CurrentItem:LookupField%], it does not follow. The workflow stops. Fail.
I can't understand the origin of that error.
Any information will be helpfull.
Workaround: Use REST CALL as you can see in the know issue. http://office.microsoft.com/en-us/help/sharepoint-server-2013-known-issues-HA102919021.aspx?ss-src=featuredhelp&ss=3f1a5755-0dad-4a34-8758-904329f5e4c9
It's a know issue, as you can see in the o365 forum.
community.office365.com/en-us/f/154/p/206482/754001.aspx
Know issues of SPD 2013:http://office.microsoft.com/en-us/help/sharepoint-server-2013-known-issues-HA102919021.aspx?ss-src=featuredhelp&ss=3f1a5755-0dad-4a34-8758-904329f5e4c9
Workaround: Use Rest Call Action.
I need the title, that is in my lookup field, but my workflow cant get this information. No if this lookup field is looking for a list in other level site.
So I will use REST CALL to my library, and get THE ID of my lookup field, and then i will do other REST CALL to that list, using the ID, and it will return my title of this item. :D
Looks easy #_# but i am not sure how to do a rest call from the workflow D:
I failed #_#... Now when I have to request something in other list, i got "Unauthorized"... really? D:
FINAL SOLUTION: We did it... You have to set app permissions for your workflow. you Can see how do it here: http://msdn.microsoft.com/en-us/library/office/jj822159(v=office.15).aspx
Don't forget: If you want to access a list in a TOP level site (main), you have to set this permission there, in the top level site. Why i am saying it? because, I set this permission on the same site where my workflow started, so when it wanted to request something in the main site, my request fail. So pay atection when do it. :)
If you have problems, count with me. \o/

Sharepoint 2010 Workflow: add task with List content

I'm managing a Sharepoint list, which is holding all our changes made in our last software iteration. Among the fields are a few pertaining to the testing process, for example a 'Testing Result' dropdown (possible values Ok/Not Ok/Todo).
I've successfully set up a Sharepoint Workflow, which assigns a "Please test this" Task to the developers, when someone sets this 'Testing result' to 'Not Ok'. This works nicely, but I would like to add some fields from the List to the Task title, to let the developers know which item they actually need to re-test.
Is this possible? I'm using Sharepoint Designer for this (it's a Sharepoint 2010 workflow)
This is possible if you create a variable and build up a string and then assign it to the Title.
you string can be made up of static text, other workflow values and fields from the list you are working or from somewhere else in the site.
Found this myself, you can add all necessary fields if you use the action 'Custom Task Process' instead of simply assigning a task.

SharePoint 2010 - Workflow randomly shows canceled

When a item is approved from the manager task the workflow updates a entry in a calendar list with the status approved. This workflow fails sometimes with the following error.
The workflow could not update the item, possibly because one or more columns for the item require a different type of information. Access Denied
I have no idea why this happens. Here is my workflow code
Your images are not showing up so this is hard to diagnose, however it seems like you are trying to pass the wrong type of value to a variable, such as a string to a date/time.

Resources