Quick Win : Allow multiple contributors on Drop-off Library items

win

Hello everyone,

Today in the Quick Win series, I will talk about a problem that may arise when working with the Content Organizer feature.

Problematic

As a reminder, the content organizer allows to classify a document based on rules. These rules are based on the metadata value and allow you to move the document to the right place.

This feature is really useful but has strange behavior.

When a person edits the properties of a document in the drop-off library and does not complete the information necessary to be classified, the document is no longer visible to other users!

Cause

When a document is added to the library, it naturally inherits permissions associated with that list.

0102

When a user edits the properties of this document, the document continues the process but remains in the drop-off library. However, an additional action is done by SharePoint => Break permissions, remove existing one and give access directly to the current user!

03

It has more than once happened that the business requirement is that several people can process a document, and potentially add each some information, before the document is finally classified.

Resolution

Several solutions are possible since this comes from a business need. In the first case, we could think of using several libraries with workflows to transfer from one library to another but it seems to me “overkill”.

I prefer to opt for the simple solution, keep the document in the drop-off library and prevent SharePoint from breaking the security! To do this, the simplest solution is to do it before it! Indeed, if the document has permissions broken, SharePoint no longer removes the permissions associated with the document!

To put this in place, SharePoint designer is our friend!

NB : I know that SharePoint Designer will not last long but currently it is a solution that works both On Premise and Online.

Steps

Create a SharePoint 2010 workflow

04

Use an Impersonation Step and remove the default step

05

Add Action « Replace List Item Permissions »

06

Give the contribution permission to the people who will use the list

07

Specify that the action should take place on the current item

08

Go to workflow settings

09

Configure the workflow to start automatically when updating a document

10.png

Publish workflow

11

When the data in a document are changed and submitted, the workflow will update the permissions with what you have specified

12

 

NB: Of course, once at destination the document will no longer have the specific permissions set in the drop-off.

Hoping this helps

Christopher

 

Quick Win – Display more view in the selector

win

Hello everyone,

Today I will inaugurate a new type of post that I want to set up, quick wins.

The purpose of these articles is to show a quick configuration to meet a common business need.

Problematic

As a user

I want to see more views in the view selector

In order to have more choice without clicking the ellipse

Cause

By default, the SharePoint view selector (in classic view) shows only 3 views among the views defined.

viewselector1

Resolution

By adding a JavaScript on the page, you can display more views. (Replace the 5 number by the number of view you want to display).

ExecuteOrDelayUntilScriptLoaded(overrideSurfacePivotCount, 'clienttemplates.js');
function overrideSurfacePivotCount() {
ClientPivotControl.prototype.SurfacedPivotCount = 5;
};

viewselector2

Hoping this helps.

Christopher.

Fix SharePoint Framework Hello World WebPart

Hello everyone,

Today I will talk about an error that may occur when you try to follow the SharePoint Framework tutorial to create the HelloWorld webpart: https://dev.office.com/sharepoint/docs/spfx/web-parts/get-started/build-a-hello-world-web-part

Problematic

When you follow the tutorial, using the “gulp serve” command generates the following errors

Error - typescript - node_modules\@types\lodash\index.d.ts(8446,32): error TS1005: ',' expected.
Error - typescript - node_modules\@types\es6-collections\index.d.ts(78,29): error TS2304: Cannot find name 'object'.

 

Cause

The SharePoint Framework evolved very quickly in a very short time. You may have a template version that is not up to date.

Resolution

To resolve these errors, simply get the last version of the template with the following command

npm install -g @microsoft/generator-sharepoint@latest

If it is not enough,  install the correct versions of lodash and es6-collection via the following commands

npm install @types/lodash@4.14.50
npm install @types/es6-collections@0.5.29

Hoping this helps

Christopher.

SyntaxError Unexpected token in JSON at position 0

Hello everyone,

Today I will talk about a problem concerning the use of PNP JS Core on an environment 2013 OnPremise.

Problematic

Like many I started using PNP JS Core for my developments. After retrieving some information and doing some conclusive tests on an Office 365 environment, I wanted to reuse my code on a SharePoint 2013 OnPremise.

And there .. Boom!

SyntaxError: Unexpected token < in JSON at position 0

The code does not have anything complicated, it will only read the contents of a list.

Reason

Looking a bit, I saw that the return of the REST call was XML and not JSON. It seems that this comes from the basic configuration of SharePoint 2013 SP1 https://github.com/SharePoint/PnP-JS-Core/issues/125

Resolution

The solution to this problem is to pass a configuration before making the call: https://github.com/SharePoint/PnP-JS-Core/pull/127

pnp.setup({
        headers: {
            "Accept": "application/json; odata=verbose"
        }
    });

Simple but when you start using PNP JS it can be useful to know.

Hoping it helps.

NB : Thanks to Yannick for helping the noobie I was in this situation !

Christopher.