Skip to main content

Posts

"The field or property 'State' does not exist."

 "The field or property 'State' does not exist." : Cause : This error will come from SharePoint (SP) REST API/endpoint if the State field is not available in required SharePoint list. Or Developer may be used wrong name of field (May be it is 'States' in SP list and developer used it as State. Solution:  1) If the field, State is 'States' in required SP list then Developer need to use it States instead of State.  2) If State/States field is not available in SP list then developer need to create State field in required SP list.

jQuery CDN

Following jQuery CDN you can use. The  jQuery CDN  is a way to include jQuery in your website without actually downloading and keeping it your website’s folder. There are a number of  jQuery CDNs  which you can use, examples –  Google ,  Microsoft ,  Cloudflare ,  jQuery own CDN  & more. https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js https://code.jquery.com/jquery-3.2.1.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js

"The property '[object Object]' does not exist on type 'SP.Data.StudentsListItem'. Make sure to only use property names that are defined by the type."

 Error: "The property '[object Object]' does not exist on type 'SP.Data.StudentsListItem'. Make sure to only use property names that are defined by the type." Cause: The above issue may come if we are trying to add/update the field name (like 'Student_x0020_Roll') but that field is not available in the Students SharePooint list. OR the field ('Student_x0020_Roll') is look up from some other list but we are tryng to updated as text field. ex. var data= { __metadata:{ type:'SP.Data.StudentsListItem' //ListItemEntityTypeFullName for list Student } 'Title':'Ramesh', 'Student_x0020_Roll':'102510', }; Solution: If required Field (like 'Student_x0020_Roll') is not available and required then we need to create it or if not required then we can removed  from saving (from data object). If the required Field (like 'Student_x0020_Roll') is lookup then we need to update it as we are updating for looku...

How to send email using SharePoint REST API in jQuery/JavaScript?

  Send email using SharePoint REST API in jQuery/JavaScript: We can able to send email to the SharePoint user using below REST API on SharePoint Online. We need to load SP.js file in code. we must need to give valid SharePoint user to send email. We can able to send email to valid SharePoint user of same organization.      var   restAPI  =  _spPageContextInfo . webAbsoluteUrl  +  "/_api/SP.Utilities.Utility.SendEmail" ;      $ . ajax ({          contentType:   'application/json' ,          url:   restAPI ,          type:   "POST" ,          data:   JSON . stringify ({              'properties' :  {             ...

How to delete a number of data at time using $batch REST API from SharePoint list?

 To delete a number of data (max-1000) at time using $batch REST API from SharePoint list:- Use below snippet to delete records from SharePoint list. The below code will help you to delete more than 1 records at single REST API. We can able to delete upto 1000 records at time. After 1000 items, it will show error like "The current change set contains too many operations. A maximum number of '1000' operations are allowed in a change set." So do not try to delete more than 1000 records at time. We can delete more than 1000 items using 200/300 records at a time single REST API call. We can call this deleteListItems function 5 to 6 times.  < script >      $ ( document ). ready ( function (){          var   data  = [         {  'ID' : 1 ,  'name' : 'Tester1' , 'email' : 'tester1@gmail.com' ,  'mobile' : 9832145326 ,  'address' : 'Gurgaon,...

"Cannot find resource for the request gettitle."

Error:   "Cannot find resource for the request gettitle.": Test REST API= _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/gettitle('Test SP List')/items Solution: As the above Test REST API is written wrong (" gettitle ") so the issue was coming. Use the below correct REST API. correct REST API = _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getbytitle('Test SP List')/items Tags: SharePoint, jQuery