Posts

Showing posts with the label SharePoint Helper

4 Useful VS Code extensions for SharePoint Framework components

Image
Hi Friends, Today I will talk about the most useful VS Code extensions, that will help in the productivity of specifically SharePoint Framework projects. As a developer, we waste a lot of time in the tasks that could be done easily via extensions support or shortcut keys. In this blog post, I will discuss some of these extensions that will increase the productivity and the style of your code. With an increase in productivity, the styling also holds an important value as it makes the code more readable and understandable which increases the focus time. So let's dive then !! VS Code Extensions !! Debugger for Chrome:  A very important extension if you are a SharePoint online developer (developing SharePoint framework components) then it is a must to have this extension. This extension helps in debugging the SharePoint Framework components just as we used to do in the C# server-side coding. For details on how to configure, you ca...

Time based query issue in SharePoint Framework

Image
Issue: Whenever you are making query to the SharePoint online using the REST API and your query is based on the time stamp, remember that SharePoint treat your time as the GMT timezone. So if you want to fetch information based on local time zone which we usually do, always set the offset and also include the daylight saving. The same is true even you are trying to put in some data to the SharePoint. You will be saving the local timezone but SharePoint will consider it as GMT time zone , and there you won’t be able to save/retrieve the correct records based on the time zone. Solution Solution is simple. SharePoint Framework webpart/extension offers this capability OOB, but there were no articles i was able to find. // will get the final offset in minutes    let finalOffset : number = this . context . pageContext . web . timeZoneInfo . offset + this . context . pageContext . web . timeZoneInfo . daylightOffset    // Now set th...

SharePoint Framework (SPFx) - Adding dynamic values in (SPFx) webpart properties

Image
Hi Friends, We usually have to add the dynamic values to the web part properties. In this blog I will be showcasing the how you can add the dynamic values to the web part properties. In this blog I will showcasing how you can fill in the drop-down values with the Title of the lists. All the lists will be fetched and then will be added to one of the web part properties. On selection of the drop-down you can see the list selected. Step 1 : Create an empty SharePoint project .  To learn how to create SharePoint Framework Project you can refer to my previous post Setup your new SPFx Project . If you have not setup your environment you can refer my blog  3 Steps to Setup your SharePoint Framework Environment . In my case I have crated Project with the name " spfx-dynamic-values-in-web-part-properties " WebPart with the name " demoDynamicValuesInWebP...

How to resolve certificate issue in SharePoint Framework Solution

Image
Hi Friends, Today i will be discussing about the certificate issue when we run the gulp command and try to run the SharePoint Framework Solution in local workbench. Issue: Warning - [spfx-serve] When serving in HTTPS mode, a PFX cert path or a cert path and a key path must be provided, or a dev certificate must be generated and trusted. If a SSL certificate isn't provided, a default, self-signed certificate will be used. Expect browser security warnings . If you read the issue , the issue is that it does not find the certificate that shows trust in the URL you are accessing, because of which you see the following message on the screen. Solution: So here is the simple solution and you won’t experience this issue any more. In your solution open the node command prompt. If you are working in Visual code then open the solution and then press the ~ + Cntrl . Now follow the 2 steps: Execute the command gulp trust-dev-cert Click Y...

SharePoint Framework Helper

Image
Hi friends, In the need to develop the solution faster and easier I have created a npm package , which will give you the flexibility to enjoy the much used logic handy and easy when writing code for SharePoint framework client side webparts or SharePoint framework extensions. This npm package contains the most commonly used logic or I should say the operations that are used almost in every SPFx client side webpart or SPFx extensions. Using this npm package you can create your webparts much more easily and faster. This is very simple and handy. This npm package code is also available on GitHub so if you are interested you can have a look at the implementation as well, or even you can request for the addition of new methods that you feel might help others as well. Why to use This library is broken into different operations, so you only need to import the operations that you want to use. Below are the operations description: SPHelperBase This is the...