Category Archives: SharePoint
Latest SPFx, web parts not appear

Using latest SPFx with node v18, pack and deploy the app no error, but web parts not appear, because you missed this. When you upgrade your SharePoint project, beware of this
PNP create a new list get 403 access denied

Create a new list in SPO via PNPjs will get 403 access denied, run this script to solve it
Change SP list into MS list

just add “?env=WebViewList” at the end of URL
Solved: SharePoint 2019 ERR_HTTP2_PROTOCOL_ERROR 

Navigate to the registry key 2.HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters. Add 2 new REG_DWORD values, EnableHttp2Tls and EnableHttp2Cleartext, to this registry key. Set both values to 0. Reboot the server  refer to https://stackoverflow.com/questions/67747270/reactjs-neterr-http2-protocol-error-200-with-netcore-in-https/67767129#67767129
SharePoint Error: apps are turned off

Solved by these commands
SharePoint Online奇怪現象

呼叫SharePoint Online Restful api時,如果ISPHttpClientOptions是空一樣能成功,但返回之時間值會錯timezone
SPFX init pnpjs

A very good provision tutorial

https://plumsail.com/docs/actions/v1.x/flow/how-tos/sharepoint/create-list-library-pnp.html
Good book about search design

spfx v1.12因為太多bug強行下架

spfx v1.12因為太多bug所以咪記已經強行下架而家變返v1.11, 之前用左v1.12請人手downgrade。玩咪記野跟車太貼有一定風險。
Import-Module : The specified module ‘OfficeWebApps’ was not loaded because no valid module file was found in any module directory.

This will fix the problem:
Pnp provision framework

Pnp provision framework has these steps: 01/20 – Regional Settings02/20 – Supported UI Languages03/20 – Audit Settings04/20 – Site Security05/20 – Fields06/20 – Content Types07/20 – List instances08/20 – Features09/20 – Page Contents10/20 – Client Side Page Contents11/20 – Site Header12/20 – Site Footer13/20 – Property bag entries14/20 – Workflows15/20 – Web Settings16/20 – Site […]
spfx becoming super slow after added package buffer

After i added : “buffer”: “^5.4.3” , the “gulp serve –nobrowser” become super slow, stuck in Starting subtask ‘configure-webpack’. I am using spfx 1.10.0 my package.json
SharePoint coloring bug using latest spfx 1.10.0

Using the latest SPFx SDK, the theme color varable $ms-color-themeDark doesn’t work, it doesn’t affect the theme color, see below To fix it add this line @import ‘~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss’;
SharePoint粉絲注意 : 新書上市Mastering Sharepoint Framework

Table of Contents1. Getting Started with SharePoint Framework2. Develop Your First SPFx Web Part3. SPFx Web Part Property Pane4. Custom Controls for Web Part Property Pane5. PnP Controls for Web Part Property Pane6. CSS Considerations7. Configure SPFx Web Part Icon8. Examine SPFx Web Parts on Modern SharePoint9. Host SPFx Web Parts from MS Azure CDN10. […]
Simplest tutorial to read yammer message in SPfx

Step 1 : Browser https://www.yammer.com/client_applications create your app Step 2 : Make sure you fill in the Javascript Origins, otherwise you will get an cors error Step 3 : Generate the developer token, we need it to send get/post form spfx Result:
My first notebook that can run SP2019 on-premises

I have to switch back to windows because almost all verilog toolchain only work in windows. And I bought MSI Prestige-15-A10X which has 32GB ram and 1TB nvms ssd, it is only $15300 HKD, super valueable. It is the first notebook which i can run a SharePoint 2019 VM locally.
How to measure an intranet portal

SharePoint的專業開發者要多注意Core.js

今天開發SharePoint SPFx項目時見到,大家多多注意Core.js這個比較底層的JS library
A new SharePoint Online error

Haven’t seen this kind of error before, i was hijacking the css by my Embed webpart, suddenly becoming this
今個月開發得比較滿意的WebPart

SharePoint “Menu Item Custom Action” – Host VS App

If you are trying to add an menu to SharePoint Online, make sure you chosee “Host Web” instead of “App Web”. If you chose wrongly, there is no way to convert it back in Visual Studio. You have to manually edit MenuItemCustomAction1\SharePointProjectItem.spdata , see below. You have to change the line from the top one […]
SharePoint App – Able to add most of the buttons

Great tutorials about SharePoint App – Ribbon button

https://mohitvash.wordpress.com/2011/07/20/ribbon-customization-add-control-to-existing-group/ http://aaclage.blogspot.com/2014/04/examples-of-customization-of-ribbons-in.html http://erikpool.blogspot.com/2011/10/understanding-crm-ribbon-xml-part-3.html
Found another way to hangs the SharePoint Online

Just created an SharePoint App project in Visual Studio 2019, create two ribbon buttons by this xml. Then back to classic mode, the ribbon tab “Items” will stop responding.
SharePoint再次提升速度

經過上星期重大upgrade, 而家速度大量提升,Create communicate site只需五秒。Deploy App 10秒內。Search亦都有肉眼看得見的速度提升。
Simplest way to add fontawesome to spfx webpart

Do this on the top of you tsx file Then put this in your render function Or
Inline style of Office Fabric UI library in spfx webpart

After upgraded the @microsoft/sp-office-ui-fabric-core library, all inline styles gone, to get it back, you just need to do: Here is the test case:
Powershell to get SharePoint group by ID

Usage: Get-SPGroup https://cf.peter.com 705
SharePoint的SPFX升級真的是千辛萬苦

由SPFx 1.0.0玩到昨天出的1.8.1,每一次升級framework都會遇到不同的麻煩。昨天Microsoft出了1.8.1,但我的Project還是用1.8.0,刪了node_module再npm i, 什麼也沒有做過就compile不到了,試了一回才發現最新版1.8.1剛出了,於是升級上去,結果又是什麼都沒有做,Project又變成可以compile到了。
不同project的不同webpart也是有機會撞ID的

寫太多webpart,終於遇到第一次撞WebPart ID,在兩個不同的spfx project裏webpart個ID重複,唯由手動改一改就可以deploy了
Build library for SPFx 1.8.0 project use has to be careful the variable name

We have a library call quantr-spfx-library, which is a supporting library for our SPFx project. I tried to update a spfx project to 1.8.0 and unable to bundle it. The error is: Here is the original code from our library: As you can see, in the second line of above code, we have a library […]
Share data between SPFx webpart

https://www.linkedin.com/pulse/share-data-between-spfx-webpart-ramakrishnan-raman
Build dynamic SharePoint search experience using refiners and paging with SPFx, Office UI Fabric and PnP JS library

http://thecollaborationcorner.com/2017/10/16/build-dynamic-sharepoint-search-experiences-with-refiners-and-paging-with-spfx-office-ui-fabric-and-pnp-js-library/ Recently, I’ve submitted a SPFx Web Part sample showing how to build a dynamic search experience using Office UI fabric components and SharePoint search REST API. This sample comes directly from a real intranet project within SharePoint Online. Why you would you like to do this? Well, if you’re currently implementing a new intranet using SharePoint […]
Using PnPjs to send requests to MS Graph with SharePoint Framework 1.6

SPFx 1.6 was released recently and a lot of new and interesting features were introduced. AadTokenProvider, AadHttpClient, MSGraphClient  went to GA, which are my favorite features. One of the common thing in SPFx development is accessing other resources, protected with Azure AD. For example you might have your LOB API with Azure AD protection and you want to […]
SharePoint Site Provisioning in Office 365 with defined permissions

Provision a site with a pre-set permissions is always a trouble for us. I found a great article here https://medium.com/provisionpoint/sharepoint-site-provisioning-in-office-365-27eaa2897776 about using pnp site template to complete this job in a easy way.
SharePoint alkamai error

Sometimes, SharePoint alkamai has lots of errors, but my webpart won’t dead and still run. But the left hand side bar will take a very long time (over 10 seconds) to load up.
Logical SharePoint Diagrams

Re-think query language – Linq

Think to develop a new query language for SharePoint to increase my dev speed, studying Linq.
終於publish左第一個reactjs+typescript的UI component上npmjs

Publish當中最唔明就係點解要自己寫tsconfig同gulp人手張typescript同scss去transpile,呢一點同java好唔同,jar就係jar,唔會理你係邊到行,但nodejs個世界唔同,production同dev版本分別好大。你自己用npx create-react-app去創建新project,的確可以係local行,但就publish唔到上npmjs成功俾人用(可能係typescript同scss太煩)。而家個我個package可以同時俾reactjs同sharepoint spfx去用,可以build UI component library了。