Is it possible to add an attachment to a new list item with UpdateListItems?
I've tried this SOAP, but no dice....
Can someone share with me the proper SOAP structure to get this done?
<SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns0:Body>
<ns1:UpdateListItems>
<ns1:listName>Some Calendar</ns1:listName>
<ns1:updates>
<Batch OnError="Continue" ListVersion="1">
<Method ID="1" Cmd="New">
<Field Name="ID">New</Field>
<Field Name="Title">Some Title</Field>
<Field Name="EventDate">2010-11-01 07:30:00</Field>
<Field Name="Attachments">
<Value Type="Attachments">/tmp/details.xml</Value>
</Field>
</Method>
</Batch>
</ns1:updates>
</ns1:UpdateListItems>
</ns0:Body>
</SOAP-ENV:Envelope>
Thanks!
Found the answer to my question. Apparently, using getlistitems to attach a file to an item is not possible. You have to get the _ows_ID value when creating the item, then use the AddAttachment method on the ID value of your item.
Related
I am attempting to connect to the PowerSchool SIS API via the Python PowerSchool library.
From the installation instructions here, I am stuck on the part where I need to create an XML file (including Oauth) for uploading as a plugin (via System > System Settings > Plugin Management Dashboard > {Your Plugin}). I am looking for an example showing how to do this in detail. I have tried looking at the information available in PowerSource here but this documentation does not show exactly what to do.
Thanks in advance for any help you can provide.
I think you must log in to the Powerschool system to install the plugin before you can connect to the API.
The plugin should look something like this...
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://plugin.powerschool.pearson.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation='http://plugin.powerschool.pearson.com plugin.xsd'
name="(Your Product Name)"
version="(Your Product Version)"
description="The plugin for PowerSchool integration with (Your Product Name)">
<oauth></oauth>
<publisher name="(Your Company Name)">
<contact email="(Your Email Address)" />
</publisher>
<access_request>
<field table="CodeSet" field="description" access="ViewOnly" />
<field table="CodeSet" field="codetype" access="ViewOnly" />
<field table="CodeSet" field="codesetid" access="ViewOnly" />
<field table="CodeSet" field="code" access="ViewOnly" />
<field table="STUDENTS" field="DCID" access="ViewOnly" />
<field table="STUDENTS" field="ID" access="ViewOnly" />
<field table="STUDENTS" field="first_name" access="ViewOnly" />
<field table="STUDENTS" field="last_name" access="ViewOnly" />
<field table="STUDENTS" field="grade_level" access="ViewOnly" />
<field table="TRANSPORTATION" field="DCID" access="FullAccess" />
<field table="TRANSPORTATION" field="ID" access="FullAccess" />
<field table="TRANSPORTATION" field="StudentId" access="FullAccess" />
<field table="TRANSPORTATION" field="Description" access="FullAccess" />
</access_request>
</plugin>
There are various places where you need to put your own information, like company name, product name, etc...
Then, you will need to put the tables and columns you want/need access to in the access_request node. Note, you must specify the type of access you require, such as ViewOnly or FullAccess.
This is a security measure. The Powerschool administrator for the school you are dealing with can then decide whether to allow the plugin or not. Once the plugin is installed, the Powerschool administrator should tell you the ClientId and the client secret to use for OAuth authentication.
I am trying to update a status filed in a SharePoint list. Did some googling, found most of the examples are using an ID column to locate the list item, but my list doesn't have such column, only a windows login and a status columns. I am wondering what the XML would be like?
This is what I come up with, but it doesn't work:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>SPUsers</listName>
<updates>
<Batch PreCalc='TRUE' OnError='Continue'>
<Method ID="1" Cmd="Update">
<Field Name="ID">ABC</Field>
<Field Name="ItemStatus">Completed?ID=ABC</Field>
</Method>
</Batch>
</updates>
</UpdateListItems>
</soapenv:Body>
</soapenv:Envelope>
This is the result:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<UpdateListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<UpdateListItemsResult>
<Results>
<Result ID="1,Update">
<ErrorCode>0x80004005</ErrorCode>
<ErrorText>Cannot complete this action. Please try again.</ErrorText>
</Result>
</Results>
</UpdateListItemsResult>
</UpdateListItemsResponse>
</soap:Body>
</soap:Envelope>
Any idea what went wrong?
Thank you.
SharePoint will generate list item ID automatically, the default view just not show the ID field, you could go to list view settings to show the field so you could know the ID.
I believe all list items in SharePoint get an auto generated ID. I'd use the list view or pull the list items to see if an id exists.
I'm trying to hide a top menu for a new custom group which I created :
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data noupdate="1">
<record model="ir.module.category" id="module_sales_users">
<field name="name">Sales Users</field>
</record>
<record id="sales_simple_user" model="res.groups">
<field name="name">Simple User</field>
<field name="category_id" ref="module_sales_users"/>
</record>
<record id="mail.mail_feeds_main" model="ir.ui.menu" >
<field name="groups_id" eval="[(3,ref('sales_simple_user'))]"/>
</record>
</data>
</openerp>
But when I assign a user to this group, the menu is always shown !
Please what's the mistake in my code ?
It's probably due that this user belongs to another group (like Human Resources) with permission access to this menu
SharePoint's telling me the following field type is 'not installed properly'
<?xml version="1.0" encoding="utf-8" ?>
<FieldTypes>
<FieldType>
<Field Name="TypeName">InfoClass</Field>
<Field Name="ParentType">Choice</Field>
<Field Name="TypeDisplayName">xyzInfoClass</Field>
<Field Name="TypeShortDescription">xyzDescription</Field>
<Field Name="UserCreatable">FALSE</Field>
<Field Name="Sortable">TRUE</Field>
<Field Name="AllowBaseTypeRendering">FALSE</Field>
<Field Name="Filterable">TRUE</Field>
<Field Name="FieldTypeClass">SharePointProject1.CustomFieldType.InfoClass, SharePointProject1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16fde6e7376d101b</Field>
<PropertySchema>
<Fields>
</Fields>
</PropertySchema>
<RenderPattern Name="DisplayPattern">
<Column HTMLEncode="TRUE" />
</RenderPattern>
</FieldType>
</FieldTypes>
I cut it down to what I pasted here and I still get the error. The namespace and assembly are correct and the dll is deployed to the GAC. Event receivers in the same project work, so I dont think it's the code. Having removed everything else I dont know what the problem could be
I'd ask in a proper sharepoint forum but I have IE7. so. this is the only site on the internet that works. and that includes the entire microsoft domain
How do i represent an image through CAML? I have a list and im trying to create a list instance by adding data through CAML
<Data>
<Rows>
<Row>
<Field Name="Title">Promotion 2</Field>
<Field Name="Promotion Image">/SiteCollectionImages/PR.gif</Field>
</Row>
</Rows>
</Data>
Have you tried:
<Field Name="Promotion Image"><![CDATA[[<IMG SRC="/SiteCollectionImages/PR.gif"/>]]></Field>
this did the trick:
<Field Name="Promotion Image"><![CDATA[<IMG SRC="/SiteCollectionImages/PR.gif"></IMG>]]></Field>
thanks Magnus