Thursday, August 20, 2015

Microsoft.SharePoint.ApplicationRuntime.SafeControlsList.GetSafeControlsListFromPath

 

I had this error appearing in event viewer when I tried to run a tool which is doing updates on SharePoint pages.

But this was working very fine in my Dev environment and it is not working on my SharePoint production servers.

Surprised isn’t It …

I tried to figure out the error nothing was successful.

But ones I tried to run the same tool of web front end servers it worked.

My server farm contains 2 application servers and 2 web front end servers. And I figured it out this error is not appearing and working fine in WFEs not App servers.

Wednesday, August 5, 2015

SharePoint 2013 List Operations in REST– Retrieve List Fields Basics

You can use the function specified in the first post to call the REST URLs. You can use the appropriate function depending on the App type you are developing.

Get selected fields in SharePoint List using SELECT REST operation.

Getting single value fields

/*
 List Name : listname
 Columns: Title => Text , ID =>  Number
*/
 
var url = "/_api/web/lists/getbytitle('listname')/items?$select=Title,ID";
 
function s(data){
 
    // get the data and convert to JSON Objects
    var d = JSON.parse(data.body).d.results[0]; 
    
    alert(d.ID);
    alert(d.Title);
    
}
 
function f(data){
    alert(data);
}
 
getREST(url,s,f);

Getting Single value Lookup fields



/*
 List Name : listname
 Columns: ID =>  Number , CountryLookup => List LooukUp 
*/
 
var url = "/_api/web/lists/getbytitle('listname')/items?$select=ID,CountryLookupId";
 
function s(data){
 
    // get the data and convert to JSON Objects
    var d = JSON.parse(data.body).d.results[0]; 
    
    alert(d.ID);
    
    // 3 , will return the ID 
    alert(d.CountryLookupId);
}
 
function f(data){
    alert(data);
}
 
getREST(url,s,f);

Getting Multiple value Lookup fields



/*
 List Name : listname
 Columns: ID =>  Number , CountryLookup => List LooukUp multiple
*/
 
var url = "/_api/web/lists/getbytitle('listname')/items?$select=ID,CountryMultiLookupId";
 
function s(data){
 
    // get the data and convert to JSON Objects
    var d = JSON.parse(data.body).d.results[0]; 
    
    alert(d.ID);
    
    // [3,5]
    var mul = data.CountryMultiLookupId.results; 
    // iterate and show the results , $.each is a jQuery function
    $.each(mul,function(i,ele){ alert(ele) });    
}
 
function f(data){
    alert(data);
}
 
getREST(url,s,f);