Skip to main content

Posts

Showing posts from 2021

Interview preparation for SharePoint SPFx and Power Apps

CSOM  CSOM allows users to access SharePoint site which are hosted outside with out using webservices like REST APIs. We have 2 options in SP. 1. .Net C# CSOM 2. JSOM CSOM happens behind. Converts API call in to XML and send to the server. Server receives the request and make appropriate calls Server gives back the data to SharePoint in the format of JSON Step 1: Create the context Step 2: Use load/loadquery to specify what data we wish to get Step 3: ExecuteQuery/ ExecuteQueryAsync Sending the request to the server Here API request sending to the server in the format of XML Step 4: Make changes to the data Step 5: Save the data using ExecuteQuery/ExecuteQueryAsyn  Here data received from the server in the format of JSON If we create sharepoint solution in VS 2012, default using Microsoft.SharePoint.Client Otherwise, for general C# code we need to add the dll and specify in .cs fil...

SPfx hosting assets on local server vs SharePoint deployment vs office 365 CDN vs SharePoint Site Assets vs Azure CDN explanation steps

How deploy spfx solutions in Office CDN or Azure CDN Local Hosting created a folder c:\A\SPFX\DeployOffice365CDNAzureCDN> create a subfolder DeployOffice365CDNAzureCDN\HostingThroughLocalServerDemo> in code, if you observe package-solution.json, includeClientSideAssets: true by default. It means, all our css,js files are part of the package that gets created as sppkg file. gulp build gulp bundle  using this we are bundling or minifying our javascript files. as soon as bundling happens, a new folder has created which named as temp. observe in folder structure. temp folder contains manifest ts file and json file. Next step is we are doing package the solution using gulp package-solution We should be getting a new folder called sharepoint. it contains solution folder, inside sppkg file. It contains one debug folder, which has all the raw files of sppkg file. In order to test our webpart, we have gulp serve. which is test the webpart in our local server. now we can observe the gu...

Deploy SPFx solution to MS Teams

Deploy SPFx webpart in MS Teams as a Tab. First create webpart solution template choose Do you allow tenant admin as yes no-javascript framework install teams js as adding as dependency to our solution. npm install @microsoft/teams-js --save Under src - webparts folder In manifest.json file, you can find supportedHosts:["SharePointWebPart"] by default. you need to add "TeamsTab" "supportedHosts": ["SharePointWebPart","TeamsTab"], now go to webpart.ts main file. we have to import microsoftteam from microsoft teams-js. import * as microsoftTeams from '@microsoft/teams-js'; Follow step from this article: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-web-part-as-ms-teams-tab

SPFx CRUD operations using React Framework code

props.ts: ICrudwithreactwebpart.ts import { WebPartContext } from "@microsoft/sp-webpart-base" ; export interface ICrudWithReactWebPartProps {   description : string ;   context : WebPartContext ;   siteUrl : string ; } ------------- main.ts CrudWithReactWebPart ,       {         description : this . properties . description ,         context : this . context ,         siteUrl : this . context . pageContext . web . absoluteUrl       } ---------------- State file: ICrudWithReactState.ts import { ISoftwareListItem } from "./ISoftwareListItem" ; export interface ICrudWithReactState {     status : string ;     SoftwareListItems : ISoftwareListItem [];     SoftwareListItem : ISoftwareListItem ; } ----------- interface: ISoftwareListItem.ts export interface ISoftwareListItem {     Id : number ;     Title : string ;   ...