infopath file extension - .xsn
List or Library template - .stp
site template extension - .wsp
Asp.net Server object model - .wsp
Silverlight Client object model -.xap
Add content type to SharePoint List/Library using REST API Use this below code to add content type to SharePoint Library using REST API. For this you need to use the content type ID. Below function will get the content type ID from content type name & we will pass the content type id to next function which will update content type to list/library. var varContentTypeName = " Your Content Type name "; var Listname = " Your List name where you want to add content type "; //This will get the content type ID from content type Name function getContentTypeID() { var deferred = $.Deferred(); var isCurrentUserIsApprover = false ; var serverURL = _spPageContextInfo.webAbsoluteUrl; var listURL = String.format(" {0}/_api/web/AvailableContentTypes?$select=Name,Id,StringId&$filter=Name eq '"+varContentTypeName+"' ",serverURL); $.ajax({ url: listURL, type: " GET ", async: false, headers:...
Create new SPFx React webpart Follow this post to create new SPFx solution & open it in VS Code. Note: All file creation & Basic details of each files are available in this post. Final Output: Here we will be getting all the SP list names into dropdown list & doing CRUD operations in the selected list. Install PnPJS: Run this below command to install PnPJS. (Note: Here we use PnPJS Version 3, sp & graph objects have been deprecated. We will be using spfi npm install @pnp/logging @pnp/common @pnp/odata @pnp/sp --save Create "pnpjsConfig.ts": In PnPJS Version 3 sp and graph objects have been deprecated and will need to be replaced ( link ). So we are using this new config file. (RightClick on webpart folder>newFile>pnpjsConfig.ts) webpart.ts: Initial...
When you try to create/update list item just check the fields details of the list using the REST API. for an example I have created a List named TestList . Following is the field details: Title: Text TestColumn1: Text Text Column 2: Text Test Column 3: People and Group Now to check the field details and check the details of the fields using the following REST API URL: http : //SITEURL/_vti_bin/client.svc/web/lists/getByTitle('TestList')/items Now you will get following data in IE Or Chrome: Find your column name from the XML page. Now check the above picture carefully, the userid needs to be saved in the TestColumn3Id column not in the TestColumn3 . Now check the following code: Go To SiteAssets and add RestPeoplePicke .js Open any page & Insert content editor webpart. Include the below code in Content Editor. //Code for content editor: <script src="https://ajax.googleapis...
Comments
Post a Comment