Hello All,
I’m facing problem during my project simple task.
Here is my requirement-
I’m creating a Sandbox solution for SPO(uploading WSP).In that solution. I’m writing code to fetch data from list and bind my data to ListView(Control).But it is not working.I don’t know why but if I write code just to simply get my Web title in Sandbox solution using CSOM(managed code) it is not working fine.
And always display error of Full Trust.
I need your attention to this.
Please suggest me something!
Thanks!☺
Hi Arun,
As per Microsoft documentation ,Sandbox is no more in SP2013 or SPO.
But still we are using SSOM in Sandbox and uploading the wsp to SPO to take output.
but my Sandbox not working with managed code.
Hi,
Please refer to below article :
https://blogs.msdn.microsoft.com/sharepointdev/2014/01/14/deprecati….
Sandbox solutions are still available but as NCSS(No Code Sandbox Solutions) which can contain JavaScript or client side code but not server side code.
Hi,
Thanks for the response.
I’m using CSOM(Managed code{C# Code}) instead of JavaScript Code.
Hi,Â
Can you Share the code you are using?
Here you have the code I use to get list data using CSOM on SPO and in versions of SP2013 without SP1 installed.
function custom_getListOnUrlName(listSiteUrl, listUrl, listName) { try {
var clientContext = new SP.ClientContext(listSiteUrl);
var oList = clientContext.get_web().getList(listUrl);
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name="Title" Ascending="True"/></OrderBy></Query></View>');
var listItems = oList.getItems(camlQuery);
clientContext.load(listItems);
clientContext.executeQueryAsync(Function.createDelegate(this, onQuerySucceeded),
Function.createDelegate(this, onQueryFailed));
} catch (err) {
try {
onQueryFailed(listName);
}
catch (err) {
console.log('Unable to get data from list');
}
}
}
function onQuerySucceeded(sender, args) {
parseItems();
}
function onQueryFailed(listSiteUrl, listName) {
try {
var clientContext = new SP.ClientContext(listSiteUrl);
var web = clientContext.get_web();
var list = web.get_lists();
var targetList = list.getByTitle(listName);
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name="Title" Ascending="True"/></OrderBy></Query></View>');
var listItems = targetList.getItems(camlQuery);
clientContext.load(listItems);
clientContext.executeQueryAsync(onQuerySucceeded, onQueryFallBackFailed);
}
catch (err)
{
onQueryFallBackFailed();
}
}
function onQueryFallBackFailed(sender, args) {
console.log('Unable to get data from list');
}