3,497 reputation
2722
bio website
location Norway
age 27
visits member for 4 years, 3 months
seen 13 hours ago

Apr
30
comment CSOM Item Level Security “Cannot add a role assignment with empty role definition binding collection.”
Note that this will not remove the existing permissions. If you want to do that you could do something like item => item.RoleAssignments when loading items and then calling item.RoleAssignments.ToList().ForEach(ra => ra.DeleteObject()); where you call BreakRoleInheritance
Apr
30
comment 2013: Trying to pass jQuery user object to AngularJS
Just found other examples where $SharePointJSOMService is a service using REST, which is not related to your code, so not sure what to make of it
Apr
29
comment REST filter=startswith not working when filtering using Id field
@NadeemYousuf autocompelte on ID? That is a new one :) I guess you are trying to do this Client-Side with the OOTB methods available, so have you tried csom?
Apr
28
comment Do check out in a document with jquery
By URL do you mean File URL? Because that is what you need. In any case there are other ways to reach the file, for example /_api/Web/Lists('<list guid>')/Items(<item id>)/File/Checkout
Apr
28
comment Do check out in a document with jquery
What do you have to begin with? Such as item ID, Document library name/id etc
Apr
28
comment SP2013 - Javascript Only Loading In Edit Mode (Pass Current User In URL to Page Viewer Web Part)
Made a example of this some days ago as well, you might find it interesting: sharepoint.stackexchange.com/a/97278/627
Apr
28
comment Do check out in a document with jquery
Forgot about X-RequestDigest, see update
Apr
28
comment How to view xml code of a list view
Have you seen sharepoint.stackexchange.com/a/15169/627 ?
Apr
28
comment App prison break
@Louis that's true, but that would be more countermeasures, and an area of much discussion. I'm only pointing out that the package labeling on apps might be misleading. By whom, why and how the trick is exploited is really hard to say
Apr
28
comment Sharepoint List Column to pdf
Well, perhaps, but the GetFieldValueAsText is a SharePoint-specific method. If you change your answer to use that I will upvote you and so you would have the correct answer. I will not delete mine as HtmlAgilityPack can make it easier to do more complicated alterations beside just html->plain string.
Apr
28
comment Sharepoint List Column to pdf
The link you gave is for Microsoft.SharePoint.Client, and not SSOM as OP has. But I believe one can do something like list.Fields.GetFieldByInternalName("Description").GetFieldValueAsText(oItem)
Apr
27
comment HTML/CSS Website conversion to Sharepoint
Are you using 2013? If so have you looked at Design Manager? It can convert HTML-pages to Masterpages including your CSS (need some custom markup)
Apr
27
comment App prison break
Not that I have a blog, but it was supposed to be community wiki, how can I turn it into that (if that would justify the post any)?
Apr
26
comment Rest API Responsive Web App
You can get the token through TokenHelper (oauthauthorize.aspx), at least for 365. But do you really need that, why can't you use CSOM? REST to your server and Web API + CSOM.
Apr
25
comment Navigation Drop-Down Menu: Pull from List
It's no problem. In all honesty you could say I was just lazy, it's not like we should let lazy people like me "hold off" answers like that :) And your answer is a good one, much better than I would have come up with
Apr
25
comment Navigation Drop-Down Menu: Pull from List
So much for asking if he is using 2013 and if he has access to Managed Metadata beforehand in a comment :P Oh well +1
Apr
25
comment Navigation Drop-Down Menu: Pull from List
Do you have Managed Metadata? Is this 2013?
Apr
25
comment how to convert from year and week number to a date? any formula to do so?
Something you want to show in a list? If you use 2013 this can be solved with JSLink, and probably in combination with moment.js (putting as comment as we don't know what version of SharePoint you use, or your approach). In moment.js it would probably be something like this: moment('14W19', 'YY{W}WW')
Apr
25
comment Who tried to access a site?
I guess you saw this answer? It is not for 2013 though, but auditing in general would be a good place to start. Another alternative is to just look at the IIS logs (or ULS, but IIS should be enough)
Apr
25
comment Rest API Responsive Web App
You can use REST towards 2013 (at least 365) from anywhere without apps (must register a dummy-app for OAuth, must obtain access token server-side), I can tell you more about this if it is what you want. But is there any reason you can't use apps? This sounds like the perfect setup for a provider-hosted app