5 Things SharePoint Client Side Developers Should Stop Doing Immediately (3/5)

Posted by: Mark Rackley on February 15, 2017

…in order to prepare for Modern sites, pages, and the SharePoint mobile application.

Okay… here we are... Day 3. Let’s see who I can make angry today? Doing this post as a five-part series is an interesting experiment on human nature. Some people think it’s great, some people do NOT like the fact that to them this stuff is common sense. I’ve even tweaked the way I’m titling it based on feedback. All in all, good stuff. I appreciate everyone’s feedback. Keep it coming!

Back to the post. Day 3. Yesterday we talked about why you should stop adding script references to your Master Pages, today we are going to talk about why you should stop modifying SharePoint’s default forms if you want to prepare for the new modern sites, pages, and the SharePoint mobile application.

Modifying default SharePoint Forms

This one stings. A few of my most popular posts deal with modifying the default forms in SharePoint by injecting some script on the page:  

 With just a little jQuery you can create cascading dropdown lists, show/hide fields, add complicated business logic or completely change the way the form looks.  Great right??

Well, not so fast. There is currently no way to inject script on list/library forms for the new modern forms. What’s more, even if you COULD inject script on those pages, any previous scripts you may have written will not work because Microsoft has completely changed the way new forms look and work. The forms are now rendered using the React framework and in no way resembles what was there before.

If you have any hopes of using the new modern pages, you’ll need to look for a different approach to customizing your forms.

Instead you should…

Well, it has been stated that the future of forms in SharePoint is Power Apps. However, there’s a good chance you won’t be able to create the complex forms you need using Power Apps. The functionality is just not there yet. If you have simple form needs definitely take a look at Power Apps and see what it can do for you. Need something more complex? There are other forms tools out there, but many of them will not work on the new modern pages.

I just happen to know of a free SharePoint forms tool called StratusForms that is compatible with the new SharePoint Framework and thus works very well with the new Modern Pages and Sites. I hear the guy that wrote the tool is kind of a jerk, but he softens up if you send him bacon. I’ve actually gone through the process of creating a form with StratusForms as a client web part on a modern page and it was fairly straightforward. I’m not sure how many other tools can do that yet? What’s the catch? To use StratusForms you need to know HTML and JavaScript, it’s not meant for business users to create forms with… yet… 

So there you have it... Short and sweet… if you are injecting scripts to customize your forms today in classic mode, it will not work on modern forms. You’ll need to prepare in order to succeed on the modern pages.

Tomorrow we’ll take this topic one step further and discuss why you should stop manipulating the DOM in your SharePoint pages altogether.

 

Topics: SharePoint, Office 365, JavaScript

Categories