Skip to content

User Field does not Appear SharePoint 2010 REST Services

I recently faced an issue where I was attempting to leverage SharePoint 2010 REST services for list data and ran into an issue with deploying a user field from Visual Studio 2013. Here were the steps I took that caused the issue and what resolved it.

1. Created a new list from a default list
2. Added a new field to the list called “Manager”
Step2AddField
3. Deploy the List to the site
4. Add a an item to the list
5. Access the REST service endpoint at
http://yoursharepointsite/_vti_bin/listdata.svc/ListName

Step4CheckOutRest

As you can see, the list is missing any reference to the manager column and even if you try to force the REST Service to return a value by attempting the following call /_vti_bin/listdata.svc/[ListName](1)/Manager you will get a 404 error.

To Fix the issue, return to your Schema.xml for the list and find the Manager field. Add these two attributes:

List=”UserInfo

And

ShowField=”ImnName

You will now see your field available in the REST endpoint:

Solved_001

Hope this helps.

TypeScript Error for ‘createDelegate’ in SharePoint Client Object Model

I was working with TypeScript recently with the SharePoint client object model I wrote the following:

context.executeQueryAsync(Function.createDelegate(this, function(s,a){}), Function.createDelegate(this, function(s,a){}));

The TypeScript compiler threw the following error:

The property ‘createDelegate’ does not exist on value of type ‘{prototype: Function; (…args: string[]): Function; new(…args:string[]):function;}’

This had me scratching my head as this should be fine and the JavaScript files were still compiling correctly. The way around this error was to create a new file and insert the following code:

interface Function{
createDelegate(obj: any, obj1: any, obj2: any, obj3: any);
}

Yes this is a quick dirty way to get around the build and deployment errors. It works though and compiles into JavaScript so you can continue to SharePoint on.

**UPDATE**  11/7/2016

With the new versions of TypeScript, I have not seen this error appear in the compiler for a while now.

Aside

SharePoint SSRS Web Part Parameters Pane Sizing Issue

I ran into this issue the other day where in an SSRS report web part’s parameters dropdown was too large to display in the SSRS web part. Take the parameter’s pane below:

2014-03-13_1111

This looks ok until you hit the dropdown:

2014-03-13_1110

Holy nested scrollbars batman…

You have a few choices:

1) Leave this parameter’s pane as is. Users will love you. #IloveSharePointReports may trend on your company’s Yammer as a result.

2) Set the height of the web part to be large enough to fit the dropdown. This is ok until the report is too large for the fixed height and you will get scrollbars for the report and this isn’t desirable either.

3) Use CSS to expand the parameter’s pane to a comfortable height to start. This is best of both worlds. The report can expand if needed and the parameters pane won’t be uncomfortably small to start.

Here is the CSS to accomplish a minimum height for the parameters pane:

.sqlrv-SeparatorContainer{
min-height:450px;
}
.sqlrv-ParameterContainerCell>div{
min-height:385px;
}

The first rule expands the arrow separating the parameters and the report. This is mainly done for aesthetics. The second rule sets the parameter pane to an appropriate minimum height. The end result is below.

2014-03-13_1112

Much better!

The only thing I didn’t test was if the pixel difference between the two was always 65 px. Can anyone confirm this?

App Failed to Deploy with No Details

Short but sweet post. I was creating a SharePoint hosted App when I ran into an issue where I downloaded a jQuery package for my and added it to my project. Upon deploying, I received the following error message:

Error occurred in deployment step ‘Install App for SharePoint’: Failed to install App for SharePoint.

To compound the issue, I was deploying to the developer preview site which meant my debugging options were limited.

Before you go tearing your hair out if you face the above issue, check all of your files in your project. I realized that the jQuery package contained sample server side code examples for different platforms. I did not need this for my app so went ahead and removed the files. The app then deployed! Hope this helps someone.

V4 Placeholders Part 1

When I first started with SharePoint, there were many things I wish I knew from the start. One of the more useful (and sometimes critical) bits of knowledge I have gathered over time is how to use Content Placeholders and their functions. This series of posts will go over the various content placeholders and their functions within a page.

Page Title

Id: PlaceHolderPageTitle
Default Content: None
Test Content:

<asp:ContentID=”Content”  ContentPlaceholderId=”PlaceHolderPageTitle”runat=”server”>
Hello World!
</asp:Content>

Result:

2012-06-07_1235
Notes: Pretty Straightforward. Puts a page title in the browser.

Additional Page Head

ID: PlaceHolderAdditionalPageHead
Default Content: None
Test Content:

<asp:ContentID=”Content”  ContentPlaceholderId=”PlaceHolderBodyAreaClass”runat=”server”>
<link href=”HelloWorld.css” type=”text/css” />
</asp:Content>

Result:

2013-01-22_1829
Notes:
This placeholder adds whatever you put inside the content placeholder inside the page head.

Body Area Class & Title Area Class (no longer used)

ID: PlaceHolderBodyAreaClass & PlaceHolderTitleAreaClass
Default Content: None
Test Content:

<asp:Content ID=”Content”  ContentPlaceholderId=”PlaceHolderBodyAreaClass” runat=”server”>
Hello World!
</asp:Content>

Result:
2013-01-22_1903

Notes: This Placeholder is not used in SharePoint 2010 anymore but is still present.

More Pictures and placeholders to come!

InfoPath List Forms on a Mac

This issue was a fun “A Ha!” moment.

I had a workflow that was sending an email and would build the body of the email in code behind. The data that I needed to send pulled from a custom InfoPath list form. I had a few fields that were multi-line text fields that users generally hit enter at the end of every item. I found out that line breaks were not populating in the email properly. I implemented the following line and the email rendered properly:

string str = workflowproperties.Item["ColumnName"].Replace("\r\n", "<br/>");

Read more…

Microsoft Surface Application Integration with SharePoint 2010

I have to give some props to our custom application development team for coming up with this application. I wanted to show a unique way to use SharePoint and also highlight an issue that could be hit with CAML queries.

We recently moved into a new office space and have a Microsoft Surface in our reception area. Our application development team had an internal project to create a WPF application that would display JPGS from SharePoint. These JPGS came from our Marketing Department that highlighted a number of the M&A projects we have done. To see the final application UI, check out the bottom of the post.
Read more…

List Forms Deployment For SharePoint 2010 Part 2 of 4

For this post, we will be adding code behind to the forms we created in part one of this series. This will allow you greater flexibility and power with your forms but takes a few more hoops to jump through in order to get everything working. This post assumes you have completed all of part one and everything is deploying without any errors.

By the end of this post you will be able to:

– Add code behind to your form

Read more…

‘IsDocument’ Managed Property Issues

For a client the other day, I was having an adventure in creating search scopes. The solution required us to only display search results for documents. Having some experience in creating custom scopes I attempted to use the “IsDocument” Managed Property. My logic was, “Hey, I’m looking for documents so I should use this property in my scope and only return results where this is true.”

I set the property for use in scopes and performed a full crawl. I created my custom scope to return results where “IsDocument=1”. I had 5 test documents (all different) on the site and each document had different types of metadata on them. When I finally used my custom search scope, only 2 of the five documents came back. I was confused because all the custom content types inherited from document content type and the value I searched for was in each of the document metadata. Read more…

List Forms Deployment for SharePoint 2010 Part 1 of 4

This post is the first in a four part series of posts about deploying SharePoint 2010 customized  list forms through Visual Studio 2010. I want these posts to help guide future endeavors in deploying forms through VS2010 so that readers can know what the options and limitations are for each type of form deployment and how to implement these forms in their WSP.

This post will show you:

– How to create a custom list aspx form for deployment in a wsp

– No code behind for this form (Part 2 will show how to add that)

Read more…