Étiquette : Programmation

Search and restore an item from a SharePoint Online Recycle Bin

It might be difficult to search for an item in a SharePoint recycle bin. I was using the end point _api/site/RecycleBin as a Site Collection Administrator, but in some cases it returns an error « The attempted operation is prohibited because it exceeds the list view threshold. ». The solution is to use another end point _api/site/getrecyclebinitems […]

Connect to SharePoint Online using an app clientId and clientSecret

Get `clientId` and `clientSecret` (source) You’ll need credentials: `clientId` – required string, client id obtained when registering the addin `clientSecret` – required string, client secret obtained when registering the addin `realm` – your SharePoint Online tenant id. The easiest way to find tenant is to open SharePoint Online site collection, click Site Settings → Site […]

spfx error: No development certificate found. Generate a new certificate manually, or set the `canGenerateNewCertificate` parameter to `true` when calling `ensureCertificateAsync`

When using the command gulp serve, you could receive the below error: No development certificate found. Generate a new certificate manually, or set the `canGenerateNewCertificate` parameter to `true` when calling `ensureCertificateAsync` To resolve, you can type gulp trust-dev-cert.

SP.Utilities.Utility.SendEmail returns « The e-mail message cannot be sent. Make sure the e-mail has a valid recipient. »

With Sharepoint you can use SP.Utilities.Utility.SendEmail to send email in JavaScript, however you could receive the below error: « The e-mail message cannot be sent. Make sure the e-mail has a valid recipient. » After searching the web, I found the solution: instead of using an email address for the recipients you have to use the userDomain […]

Create a self-signed certificate for localhost testing with IE11 and Webpack

Sources: https://stackoverflow.com/questions/44988163/create-self-signed-certificate-for-testing-localhost-and-have-it-accepted-by-the http://woshub.com/how-to-create-self-signed-certificate-with-powershell/ https://stackoverflow.com/questions/4691699/how-to-convert-crt-to-pem/4691749#4691749 https://webpack.js.org/configuration/dev-server/#devserver-https If you develop with Webpack under Windows and you want to open your localhost server in HTTPS with IE11 you may receive a message like : « Content was blocked because it was not signed by a valid security certificate. » Below I explain the steps to make it work with IE11: […]

Remove custom properties/metadata for an Office document [javascript]

I have this document library on Sharepoint where I have one custom column called Metadata and that is a lookup to another list on my Sharepoint. When the users download an Office document from this library and then re-upload it we could have the below error message: There is at least one lookup column that […]

How to delete a document locked by another user in Sharepoint using JavaScript

When you open a file from Sharepoint, it will receive a short term lock that will prevent others to change some properties on the file. This protection can be useful, but also very annoying, for example when the file is not closed properly, then the lock could stay « forever ». There are many posts on the […]

How to drag and drop a file into a dropzone in HTML5

We can find plenty of demo and tutorials about it on the web, but it took me a while to understand how to setup something easy and quick. The purpose is to have a zone where we can drop a file from our computer. You need: A zone where the file will be dropped (for […]

Overwrite the Created field for a Sharepoint list item

Sharepoint provides automatic fields, like « Created » that contains the creation date of a list item. It’s a readonly field. You could use a webservice to change the ReadOnly property in order to overwrite its value. Using SharepointPlus the code is: // don’t change the below information // the details about this field are found using […]