Add post in Newsfeed using sandbox solution
Hi.
How to add post in newsfeed using C# with sandbox solution 2013.
Or
How to add post in newsfeed using javascript without .Net frame work
http://msdn.microsoft.com/en-us/library/office/jj164025%28v=office.15%29.aspx// Create the post content.var postCreationData = new SP.Social.SocialPostCreationData();
postCreationData.set_contentText('The text for the post, which contains a {0}.');
postCreationData.set_contentItems(socialDataItems);
If this helped you resolve your issue, please mark it Answered
Similar Messages
-
How can I send an email from Sharepoint Online using sandbox solution?
How can I send an email from Sharepoint Online using sandbox solution?
If possible I do not want to use workflow.
Is It possible to do it without using workflow?hello Steven Andrews,
when any user sends a message using contact us page in SharePoint online.
1. We are inserting item in Contact Us List . - This is working fine
for anonymous users also. We have used Office365 anonymous codeplex wsp and it is working fine. Anonymous user is able to insert new record in the Contact Us List.
2. Once, new record is inserted in Contact Us list, we want to fire email notifying thanks to the user on his email id as well as to our company x person for notification of new inquiry.
We tried using Workflow having impersonation step for anonymous user but it is not working for Anonymous users. Workflow is able to sent the email if someone logged into system but not working for Anonymous user although workflow is getting started
but not able to send email although used Imperonsation step.
We are stuck into implementing second step. -
How to add new entry of a sandbox solution to Office 365 standard menu
Hi,
I have created a sandbox solution for office 365. I want that web part to be accessed from SharePoint Standard menuitem.
It should be next to Add an App.How could i do that?<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="----"
GroupId="SiteActions"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="2000"
Title="====Project"
Description="Create Project">
<UrlAction Url="~site/SitePages/=-=-=.aspx"/>
</CustomAction>
</Elements> -
Creating Termset and terms in Taxonomy using Sandboxe Solution in Sharepoint 2013
I created a Sandboxed Solution, Added one Visual web part in that solution with one button control. Added Microsoft.Sharepoint.Taxonomy.dll Reference to the solution. Then in the button click event i wrote the following code:
SPSite site = SPContext.Current.Site;
var taxonomySession = new TaxonomySession(site);
var termStore = taxonomySession.DefaultSiteCollectionTermStore;
lbl1.Text = termStore.ToString();
var termStoreGroup = termStore.CreateGroup(txtTermSetGroupVal.Text);
var termSet = termStoreGroup.CreateTermSet(txtTermSetCatNameVal.Text);
termSet.CreateTerm("AAA", CultureInfo.CurrentCulture.LCID);
termSet.CreateTerm("BBB", CultureInfo.CurrentCulture.LCID);
termStore.CommitAll();
Then, I deployed this solution in one Publishing site. Added one new page in that site and Inserted this visual webpart in that page. When i click that button, I got the
following error,
Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. Correlation ID: 49c1759c-5913-70a8-76e3-b2827260601a.[SPUserCodeSolutionExecutionFailedException:
Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred.]Hi,
The Yammer, OneDrive, Sites , My Sites and so on are buttons in the suite bar, the BROWSE, PAGE, SHARE etc. are the buttons in the ribbon, the two bars are added to the master
page automatically during the converting process.
A workaround is that we can hide the ribbon by using such a CSS code:
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
Adding file in SharePoint document Library using sandbox solution
Why I am Missing Uploaded File name In Post back & am unable to add debugger give me solution thanks in advance
Below is my sample code
protected void btnsubmit_Click1(object sender, EventArgs e)
try
//upload Image
web.AllowUnsafeUpdates = true;
Boolean replaceexistingfile = true;
if (Filephoto.HasFile)
Stream fStream = Filephoto.PostedFile.InputStream;
byte[] contents = new byte[fStream.Length];
fStream.Read(contents, 0, (int)fStream.Length);
fStream.Close();
string FileName = Filephoto.FileName;
string destUrl = SPContext.Current.Web.Url + DocumentLibName + FileName;
web.Files.Add(destUrl, contents, replaceexistingfile);
SPFile file = web.Lists[DocumentLibName].RootFolder.Files.Add(FileName, contents, replaceexistingfile);
lblliteral.Text = file.ToString();
SPFieldLookupValue value = new SPFieldLookupValue(listitem.ID, listitem["EmployeeCode"].ToString());
file.Item["EmployeeCode"] = value.ToString();
file.Item.Update();
else
//throw new FileNotFoundException("File Not Found");
string FileName = "nofile";
lblliteral.Text = FileName + "filepload" + FilePassport.FileName + " : " + FilePan.FileName;
web.AllowUnsafeUpdates = false;
catch (Exception ex)
// Page.Response.Write(ex.Message);
string FileName = ex.Message;
lblliteral.Text = FileName;
Hi,
We can put into the Session, the code snippet for your reference:
//If first time page is submitted and we have file in FileUpload control but not in session
// Store the values to SEssion Object
if (Session["FileUpload1"] == null && FileUpload1.HasFile)
Session["FileUpload1"] = FileUpload1;
Label1.Text = FileUpload1.FileName;
// Next time submit and Session has values but FileUpload is Blank
// Return the values from session to FileUpload
else if (Session["FileUpload1"] != null && (! FileUpload1.HasFile))
FileUpload1 = (FileUpload) Session["FileUpload1"];
Label1.Text = FileUpload1.FileName;
// Now there could be another sictution when Session has File but user want to change the file
// In this case we have to change the file in session object
else if (FileUpload1.HasFile)
Session["FileUpload1"] = FileUpload1;
Label1.Text = FileUpload1.FileName;
More information about the similar issue:
http://www.codeproject.com/Tips/101834/How-to-Maintain-FileUpload-Control-s-State-after-P
If you want to upload file into document library, here is another option for your reference:
http://purtuga.github.io/SPWidgets/
Best Regards
Dennis Guo
TechNet Community Support -
Web Part Error in Sandbox solution
Hi, I used the following code for "ADD POST IN NEWSFEED USING C#" in sandbox solution 2013.
string serverUrl = "http://sanchit:5097/";
string accountName = @"tafecorp\spservices";
SocialDataItem userMentionLink = new SocialDataItem
ItemType = SocialDataItemType.User,
AccountName = accountName
SocialPostCreationData postCreationData = new SocialPostCreationData();
postCreationData.ContentText = "{0} does great work!";
postCreationData.ContentItems = new SocialDataItem[1] { userMentionLink, };
try
ClientContext clientContext = new ClientContext(serverUrl);
SocialFeedManager feedManager = new SocialFeedManager(clientContext);
feedManager.CreatePost(null, postCreationData);
clientContext.ExecuteQuery();
lblReport.Text = "The post was published";
catch (Exception ex)
lblReport.Text = ex.ToString();
When i run the code the following error comes. How to solve this issue. Thanks in advance.
Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. Correlation ID: 5f639c9c-7639-50f3-7dce-34ae387d3ed0.Share the details about correlation ID in ULS logs
http://sharepoint.stackexchange.com/questions/59679/sandbox-unhandled-exception-was-thrown-partial-trust-app-domain
Well it's taken a few days but I've finally managed to work this one out however it did involve me having to dissect the whole project and reintroduce each piece one at a time.
A few issues were causing it:-
1) I had set one of the projects "Include Assembly in Package" property to false.
2) A static method was making a call to an SPList which turned an empty (null) value. Added a value to that item and the error disappeared.
3) I'd declared a variable as being of type double and set its default value as 0.
Now why the system couldn't have told me that's what the problems were rather than throwing this generic error is a different story! It would have saved me many an hour of confusion.
http://stackoverflow.com/questions/3905388/sharepoint-2010-sandboxed-webpart-error
http://social.technet.microsoft.com/Forums/sharepoint/en-US/c11ab5df-562e-43b4-b350-5c4d07da8bf3/sandbox-solution-error-unhandled-exception-was-thrown-by-the-sandboxed-code-wrappers-execute?forum=sharepointgeneralprevious
http://sohilmakwana.wordpress.com/2013/11/29/sandbox-error-unhandled-exception-was-thrown-by-the-sandboxed-code-wrappers-execute-method-in-the-partial-trust-app-domain/
If this helped you resolve your issue, please mark it Answered -
Created a new SharePoint 2010 List Definition project, Sandbox deployment option. List Definition type: Documents Library. When attempting to save into the document library from Microsoft Word 2010 I get "The webpage no longer exists" error in
the File Save dialog
If I change the type of the solution to Farm solution it works as expected.
IISLOGS:
2013-12-19 10:12:01 127.0.0.1 PROPFIND / - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 35
2013-12-19 10:12:01 127.0.0.1 PROPFIND /sites - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 26
2013-12-19 10:12:01 127.0.0.1 PROPFIND /sites/team1 - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 30
2013-12-19 10:12:01 127.0.0.1 PROPFIND /sites/team1/Lists - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 32
2013-12-19 10:12:01 127.0.0.1 POST /_vti_bin/shtml.dll/_vti_rpc - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 200 0 0 10
2013-12-19 10:12:01 127.0.0.1 HEAD /sites/team1/_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.*&location=Lists/ListDefinitionProject1-ListInstance1 80 - 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 401 0 0 6
2013-12-19 10:12:01 127.0.0.1 HEAD /sites/team1/_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.*&location=Lists/ListDefinitionProject1-ListInstance1 80 - 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 401 1 2148074254 2
2013-12-19 10:12:01 127.0.0.1 HEAD /_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.*&location=Lists/ListDefinitionProject1-ListInstance1 80 0#.w|domain\username 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 200 0 0 23
2013-12-19 10:12:01 127.0.0.1 GET /sites/team1/_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.docx&location=Lists%2FListDefinitionProject1-ListInstance1 80 - 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 401 0 0 10
2013-12-19 10:12:01 127.0.0.1 GET /sites/team1/_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.docx&location=Lists%2FListDefinitionProject1-ListInstance1 80 - 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 401 1 2148074254
2
2013-12-19 10:12:01 127.0.0.1 GET /_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.docx&location=Lists%2FListDefinitionProject1-ListInstance1 80 0#.w|domain\username 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 410 0 0 34
2013-12-19 10:12:01 127.0.0.1 PROPFIND /sites/team1/Lists/ListDefinitionProject1-ListInstance1 - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 36Hi,
According to your post, an error occurred when you used the custom Documents Library(List Definition using sandbox solution).
Please check whether you have removed <ContentTypeRef/> in the <ContentTypes/> tag of Schema.xml file in your project.
Here is a sample about list definition deployed as a sandbox solution, you can take a look at:
http://sharepointbuzzer.com/2010/10/21/list-definition-using-sandbox-in-sharepoint-2010/
Best Regards
Dennis Guo
TechNet Community Support -
Sharepoint Taxonomy Control in sandbox solution in sharepoint 2013
Hi,
We have requirement to bind termsets into taxonomy control using sandbox solution in sharepoint 2013.
I cannot use webpart,and APP. Below code added in aspx page in module.
i cannot write any code as this sandbox solution.
<%@ Register Tagprefix="TaxonomyField" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint.Taxonomy, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
%>
<TaxonomyField:TaxonomyWebTaggingControl ID="TWC" runat="server" SspId="08d413ac-c81d-4232-b1df-c2da46f9b21a" TermSetId="06c93fa1-8a76-4637-9b87-5e612276c199" AllowFillIn="true" IsMulti="false"
IsDisplayPickerButton="true" Language="1033" IsAddTerms="true" >
</TaxonomyField:TaxonomyWebTaggingControl>
This is able to render the control, where as termsets are not being displayed.
Please help on this.
-NavyaI don't think hard coding SSPID and TermsetID is a good practice. Try to get the values through code and using unique names.
<Taxonomy:TaxonomyWebTaggingControl ID="TWC" IsDisplayPickerButton="true"
AllowFillIn="true" runat="server"
ShowTaxonomy(TWC, TaxonomyGroup, TermSetName);
public static void ShowTaxonomy(TaxonomyWebTaggingControl control, string taxonomyGroup, string termsetName)
SPContext context = SPContext.Current;
SPSite site = context.Site;
TaxonomySession tsession = new TaxonomySession(site);
TermStore ttermStore = tsession.TermStores["TermStore"];
Group tgroup = ttermStore.Groups[taxonomyGroup];
TermSet productsTermSet = tgroup.TermSets[termsetName];
control.SspId.Add(ttermStore.Id);
control.TermSetId.Add(productsTermSet.Id);
control.IsAddTerms = false;
control.AllowFillIn = false;
control.IsMulti = true;
control.IsIncludeUnavailable = false;
control.Language = 0;
if(termsetName==Constants.UserKeywordsTermSet)
control.AllowFillIn = true;
control.IsAddTerms = true;
Bala -
Is any big enterprise write any sandbox solution in SharePoint 2013? If any enterprise already developed Sandbox solution in a large scale manner what option they have now to migrate it to SP 2013?
Is Sandbox is implemented only for on-premise application? Or it is implemented for online also?
Plz share your exclusive real-time experience.I think sandbox solutions are "stuck in the middle" right now. If you need full access to all of SharePoint, you must do a full-trust model. If you want total isolation, the new App Model does a better job of isolation. So sandbox solutions (to me) seem
like the bridge between the old full-trust model and the new cloud app model. The (few) companies that I have seen using sandbox solutions are using them because they are managing their own on-premise SharePoint farms with mature governance processes to allow
sandbox solutions to be deployed. If companies embraced this approach for 2010, it is still supported in SharePoint 2013. However, for new development, I would encourage you to take a look at the new Cloud App Model to see if your new development can match
this model. http://msdn.microsoft.com/en-us/office/dn448480
Andrew Connell does an excellent job on his blog outlining the characteristics of the three app models and when to consider each one.
http://www.andrewconnell.com/blog/Understanding-SP2013-Apps-aka-Apps-101 -
Sandboxed solution file attachement
Is it possible to attach a file in a list using Sandboxed solution??
please suggest how can we do that through code(c#)By default the answer is no. You cannot.
Here is something previously bookmarked for uploading via the Client OM, this code should be Sandbox compatible.
http://blogs.msdn.com/b/sridhara/archive/2010/03/12/uploading-files-using-client-object-model-in-sharepoint-2010.aspx
You can also try below
http://www.microsofttechnology.net/2013/10/attach-file-to-sharepoint-list-item-by.html -
Is there any way to deploy the Sandbox solution .wsp file to sharepoint 2013 online publishing site using powershell or CSOM or any other way?
Hi,
According to your post, my understanding is that you wanted to deploy sandboxed solution .wsp file to sharepoint 2013 online.
"Add-SPSolution" command is not available in SharePoint Online management shell. So, we cannot use PowerShell to update and deploy a solution in SharePoint Online environment. Meanwhile, here is index of Windows PowerShell for SharePoint Online
cmdlets for your reference:
http://technet.microsoft.com/en-us/library/fp161364.aspx
You can CSOM to deploy solution using helper class from CodePlex. The activation code is as follows: SandboxSolutions.ActivateSolution(siteCollectionURl, cookies, "solution_name.wsp");
About the Client Side Object Model (CSOM), it is a development related issue, we have a specific support channel for the SharePoint developers, so I recommend you go to our MSDN forum for further assistance.
Here is a similar thread for you to take a look at:
http://community.office365.com/en-us/forums/156/t/197404.aspx
In addition, if you would like to upload and activate sandbox solution manually, you can refer to:
http://community.office365.com/en-us/forums/154/p/64010/244496.aspx#244496
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Error while deploying Sandbox Solution in SharePoint 2010 using Visual Studio
Hi,
I am creating a custom webpart as a sandbox solution.
While deploying I am getting an error
Error occurred in deployment step 'Retract Solution': <nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied.
I have necessary permissions and part of admin group.
Please suggest what could be the issue.Hello,
can you check if your account have access to the SharePoint_Config database? if it's still doesn't work, check if the used account is a local administrator of the machine
Best regards, Christopher.
Blog |
Mail
Please remember to click "Mark As Answer" if a post solves your problem or
"Vote As Helpful" if it was useful. -
Add Event Receiver on Existing List in SandBoxed Solution
Hi Guys,
I have Created One Event Receiver which is of type SandBox Solution and now i am programatically adding Event Receiver to a Specific List Instance Which is Existing on Site.But
SPEventReceiverDefinitionCollection.Add() method is NOT available for Sandbox
solutions. Any Help would be Appreciated.
Thanks,
Nisarg S MoreChristoffer,
And that's really straight-forward using the same method. Just change the Receivers element to target the specific list rather than the list template. Example:
<Receivers ListUrl="Lists/Test">
This works fine for me. Let me know if it doesn't work.
Thanks,
Dallas -
Activate design manager (sandbox) solution using power shell - SP2013
Hi All,
I have a design manager (sandbox) solution and deployed in site collection. I am trying to upload the new version using power shell.
Uninstall-SPUserSolution , Remove-SPUserSolution, Add-SPUserSolution and finally doing Install-SPUserSolution on that time i am getting the following error " Install-SPUserSolution : This file may not be moved, deleted,
renamed, or otherwise edited." kindly help me for this issue.
Regards,
SanthoshCan you please provide more details on your solution package? Did you use SharePoint Design Manager to create design package? If that is the case then if you read the following article it reads and
"In SharePoint 2013 you cannot uninstall an imported design package, and you should never attempt to deactivate a design package through the solution gallery."
I think if you read the article it might be helpful.
http://msdn.microsoft.com/en-us/library/jj862342.aspx
Amit -
Sandbox Solution to create a Publishing page using page layout.
How to create a Sandbox Solution to create a Publishing page using page layout.
Hi Sriram,
You can use the below code
using (SPSite site = new SPSite(url))
using (SPWeb web = site.OpenWeb())
web.AllowUnsafeUpdates = true;
SPList wiki = web.Lists["Pages"];
String urlWiki = wiki.RootFolder.ServerRelativeUrl.ToString();
PublishingSite pubSite = new PublishingSite(web.Site);
string pageLayoutName = "Layoutname.aspx";
string layoutURL = web.Url + "/_catalogs/masterpage/" + pageLayoutName;
PageLayout layout = pubSite.PageLayouts[layoutURL];
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
string pageName ="home.aspx";
PublishingPage newWikiPage = null;
newWikiPage = publishingWeb.GetPublishingPages().Add(pageName, layout);
newWikiPage.Title ="";
newWikiPage.Update();
web.AllowUnsafeUpdates = false;
A'Kumar
Maybe you are looking for
-
Video on my 8310 no longer works
When I first got my phone I took a short video,which I can see but now I can no longer see how I took it. My wife has the same phone and I can't find the option on hers either? I have looked thru many posts but none really helped. Thanks Solved! Go t
-
Crystal Reports XI via ODBC to Lotus Domino Database - crashes client
As soon as I attempt to connect a CR XI report via ODBC to a particular Lotus Domino database my Crystal client crashes with the below error message in the event viewer. I regularly connect to other Lotus Notes databases but this one crashes my clien
-
Icant open a libyry/projekt "Gotland" . I get this mesage There was an error opening databas for the libery " / Volumes/hasse Exstended / Gotland .aplibray" Plese help , i have open this befor whit no problem?????
-
Exchange permissions between 2 domains, separate forests
We have a partner division on our network, they have thier own domain(s) but we provide email for them. We have no control over thier domain at all, we have a two-way trust and thats as far as our connection and access goes. Our Domain (A) has accoun
-
Sandbox server - SP2010 installation
Hi all, I have given a sandbox server with Windows server 2008 and SQL server 2008 for which the hostname, domain name and ipconfigurations are already configured with our organizations default settings, now i have been asked to install SP2010 on tha