Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all 11508 articles
Browse latest View live

Indentify deleted (recycle bin) items in SP10/13

$
0
0

I'm trying to find all documents on a sharepoint server, including the ones that are in the recycle bins.

At the moment I'm using the following to find all items in the document libraries

foreach (SPWebApplication app in SPWebService.ContentService.WebApplications) {
foreach (SPSite site in app.Sites) {
foreach (SPWeb web in site.AllWebs) {
foreach (SPList list in web.Lists) {
if (list is SPDocumentLibrary) {
foreach (SPListItem item in list.Items) ...

and accordingly for finding all items in the recycle bins:

foreach (SPWebApplication app in SPWebService.ContentService.WebApplications) {
foreach (SPSite site in app.Sites) {
foreach (SPWeb web in site.AllWebs) {
SPRecycleBinItemCollection recycleBinItems = web.RecycleBin;
foreach (SPRecycleBinItem recycleItem in recycleBinItems)

This gives me all the documents, BUT since a recycle item has another ID/GUID then a list item I am unable to identify the recycle bin items since identifying them with their title is not enough for me.

Is there any way to access their previous GUID without restoring them or searching them differently to get the GUID directly?


RE: Removing Code-Based Sandbox Solutions in SharePoint Online (.wsp files)

$
0
0

Good afternoon,

Microsoft appear to be removing code-based sandbox solutions in SharePoint online:

I have been using an on-premise SharePoint Enterprise solution since 2012 that included a code-based .wsp sandbox solution  that shows SharePoint Version in Office Documents, available for free at CodePlex.

We are planning to replace our on-premise SharePoint solution with SharePoint online, however if we can't take the code based sand-boxed .wsp solution across then it jeopardises our plans as we need the versioning functionality it provides.

Having set up a TEST SharePoint online account, the .wsp solution still works for now, but I'm concerned that this will be pulled in the future.

As such, can anybody recommend a path for me having the existing .wsp solution converted/emulated to a SharePoint online add-in/app please? I am not a developer so wouldn't know where to start, who to approach or whether this is even possible.

Many thanks,

Phil

InfoPath GetUserProfilebyName Web Service not working in sharepoint 2013

$
0
0

i have a 2013 site in that i need to get user information using GetUserProfilebyName Web Service in info path form, but when i publish that form it shows below error while opening form using New item. it is working fine in share point 2010,is there any way to use that web service in 2013 or anyone get user details without error.



How can i configure SMTP in sharepoint web.config file programmatically

$
0
0
I want to set SMTP configuration in web.config in <system.net> while web application feature is activate from central admin.

An error occurred while trying to connect to a Web service.

$
0
0

I do have a SharePoint 2010 site and there are around  350+ SharePoint user groups, most of SharePoint groups has limited permission at site, means groups has directly permission at list and items.

Recently we encountered while accessing infopath form but its works fine when user removed from some specific SharePoint groups. I am not sure how to analyze which groups has issue.

Below is the error message

"An error occurred while trying to connect to a Web service."

In ULS log the message is as below:

Could not   initialize group data fromhttp://site.company.com:   Microsoft.SharePoint.SPException: Group cannot be found.
Failed to get SPGroupName from GroupID.   Error Message: Group cannot be found.   Callstack:    at   Microsoft.SharePoint.SPGroupCollection.GetByID(Int32 id)    at   Microsoft.SharePoint.WebControls.PeopleEditor.set_SharePointGroupID(Int32   value).
Setting database session for   {5ca94e09-d085-4d79-ac1e-0999e409eae4}.
ConnectionString: 'Data   Source=DB instance;Initial   Catalog=DB_Name;Integrated   Security=True;Enlist=False;Connect Timeout=15'   ConnectionState: Closed ConnectionTimeout:   15
Could not initialize group data from  http://site.company.com:   Microsoft.SharePoint.SPException: Group cannot be found.

Failed to get SPGroupName from GroupID.   Error Message: Group cannot be found.   Callstack:    at   Microsoft.SharePoint.SPGroupCollection.GetByID(Int32 id)    at   Microsoft.SharePoint.WebControls.PeopleEditor.set_SharePointGroupID(Int32   value).

------------------

The following   query failed: _GetList (User:   account ID, Form Name: ListName, IP: , Connection Target:  http://site.company.com/K2 BlackPearl Data   Connections/InfoPath Web Service/Execute Smart Object Method.udcx, Request:   http://site.company.com/_layouts/FormServer.aspx?XsnLocation=http://site.comany.com/Listname/Forms/Listname-myXSD-2016-08-18T07-00-58.xsn&SaveLocation=http://site.company.com/Listname &ClientInstalled=true&Source=http://site.company.com/listname/Forms/AllItems.aspx&DefaultItemOpen=1,  Form ID: urn:schemas-microsoft-com:office:infopath:Listname:-myXSD-2016-08-18T07-00-58   Type: DataAdapterException, Excepti...
...on Message: The remote server   returned an error: (500) Internal Server Error. Server was unable to process request.   ---> Exception of type   'SourceCode.SmartObjects.Client.SmartObjectException' was thrown. The remote   server returned an error: (500) Internal Server Error.)
Failed to get SPGroupName from GroupID.   Error Message: Group cannot be found.   Callstack:    at   Microsoft.SharePoint.SPGroupCollection.GetByID(Int32 id)    at   Microsoft.SharePoint.WebControls.PeopleEditor.set_SharePointGroupID(Int32   value).


Santosh sethi




Scheduled PowerShell Wont Write to Text File (SharePoint 2010)

$
0
0

Hi All,

My PowerShell script runs fine from the PS shell and shows the web applications details for the SharePoint Farm.

But It doesn't work from Task Scheduler, either from the scheduled time or just from the Task Scheduler list and right-clicking and selected Run. It creates the log file from Task Scheduler However, doesn’t write back the web application details in the log file.

Note: It writes the 'Hello' string using Write-OutPut in the text log file.

Here is the PowerShell Log Output:

Here is PowerShell Script:

In Task Scheduler, I have the "Actions" set to Start a program, PowerShell.exe.

Has anyone come across this issue and let me know what I am missing?

I really appreciate your help. Thank you.


Cheers, Badal Ratra MCTS

Evernote Integration SharePoint ??

$
0
0

Can anybody help me to Integrate Evernote with SharePoint?? Any custom solution or OOB.

Thanks,

Anurag

Custom Master Page for Page Layout?

$
0
0

I would like to develop a third custom master page (besides default and custom master pages). Is it possible? I have a requirement to specify custom master page to a page layout. Is that possible?

Default and custom are already taken so how can I specify custom master page to page layout? Am I going in the correct direction?

I do not want to go into site settings > master page and specify the custom master page to all the subsites since it is going to be only for one subsite.

Thanks!



SP2010 List Workflow does not run when Powershell script run from Windows Task Scheduler

$
0
0

I have created a PowerShell script to upload a document to a SP2010 Foundation library (PUBQ). The PUBQ library has a list workflow that is configured to run when items are created or updated. Using a service account that is configured only as a site collection administrator, I can run the PS script from the desktop and it works perfectly. When I launch the script from Windows Task Scheduler, all works accept the workflow does not run.

From Windows Task Scheduler, I start the command with powershell.exe -version 2 -ExecutionPolicy unrestricted {script}

It is like the scheduled task is perceived as a "System Account" and blocks workflow.

Any ideas?

SharePoint Home Page design Example??

$
0
0

I am designing my SharePoint portal for Government Client.. they are looking for eye catching home page , each subsite have different master page(look and feel). Please share some example with me.

Thanks,

Does SharePoint Designer 2013 support adding external column in list (similar adding to list column)

$
0
0

Does SharePoint Designer 2013 support adding external column in list (similar to adding to list column).

We can add from front end( website)

.0x80004005 Cannot complete action

$
0
0

Although I have seen many forum entries asking for a fix for this error, I find that this exception occurs in many different situations.

I have a Page Layout connected to a Content Type. The Content Type has deployed fine with it's custom fields. I then created a page layout and referenced the Content Type that I created.

Creating a new page from this Page Layout, gives me the above error.

Here is the Stack trace:

[COMException (0x80004005): Cannot complete this action.

Please try again.<nativehr>0x80004005</nativehr><nativestack></nativestack>]
   Microsoft.SharePoint.Library.SPRequestInternalClass.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd) +0
   Microsoft.SharePoint.Library.SPRequest.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd) +153

[SPException: Cannot complete this action.

Please try again.]
   Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) +27379170
   Microsoft.SharePoint.Library.SPRequest.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd) +245
   Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op, Boolean isMigration, Boolean fResetCTCol) +449
   Microsoft.SharePoint.SPContentType.ProvisionFieldOnList(SPField field, Boolean bRecurAllowed) +1547
   Microsoft.SharePoint.SPContentType.ProvisionFieldsOnList() +634
   Microsoft.SharePoint.SPContentType.DeriveContentType(SPContentTypeCollection cts, SPContentType& ctNew) +671
   Microsoft.SharePoint.SPContentTypeCollection.AddContentTypeToList(SPContentType contentType) +2319
   Microsoft.SharePoint.SPContentTypeCollection.AddContentType(SPContentType contentType, Boolean updateResourceFileProperty, Boolean checkName, Boolean setNextChildByte) +242
   Microsoft.SharePoint.SPContentTypeCollection.Add(SPContentType contentType) +24
   Microsoft.SharePoint.Publishing.PublishingWeb.ForceAddContentTypeToList(SPContentType contentTypeToAdd) +180
   Microsoft.SharePoint.Publishing.PublishingWeb.AddPageLayoutOnListIfNeeded(PageLayout layout) +164
   Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PageLayoutAction.changePageLayout(String newPageLayoutUrl) +191
   Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PageLayoutAction.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

Any help will be much appreciated.

Thanks

Delete the metadata Term from a specific TermSet - sharepoint 2013

$
0
0

Hi Folks, 

Is there any tool or PS script available to delete the terms from a specific termset ?? 

we have about 900 terms that are to be deleted from a specific TermSet. 

please help me out with this .. would appreciate any help 

The control with ID 'WebPartAdderUpdatePanel' requires a ScriptManager on the page.

$
0
0

I am trying to develop a custom master page. When I preview it, I get the below error:

The control with ID 'WebPartAdderUpdatePanel' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it. 

Here is where I included scriptmanager in the master page:

=====

<body onhashchange="if (typeof(_spBodyOnHashChange) != 'undefined') _spBodyOnHashChange();"><!--MS:<SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server">--><!--MS:<WebPartPages:SPWebPartManager runat="server">--><!--ME:</WebPartPages:SPWebPartManager>--><!--ME:</SharePoint:AjaxDelta>--><!--MS:<SharePoint:SPClientIDGenerator runat="server" ServerControlID="DeltaPlaceHolderMain;DeltaPlaceHolderPageTitleInTitleArea;DeltaPlaceHolderUtilityContent">--><!--ME:</SharePoint:SPClientIDGenerator>--><!--MS:<SharePoint:ImageLink runat="server">--><!--ME:</SharePoint:ImageLink>--><!--MS:<SharePoint:SharePointForm onsubmit="if (typeof(_spFormOnSubmitWrapper) != 'undefined') {return _spFormOnSubmitWrapper();} else {return true;}" runat="server">--><!--SPM:<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true"/>-->

What am I doing wrong? If I move scripmanager just below body element, the corresponding .aspx seems to be duplicating scriptmanager elements. Any pointers?

Getting 403 forbidden error in responseCode while connecting to Office 365 share point using java code

$
0
0

publicstatic String copySharepointLocation(StringsrcFileName, StringdestFolder)   {

              CloseableHttpClienthttpclient =null;

             intresponseCode = 0;

              StringretValue ="";

              CloseableHttpResponseresponse =null;

             try{

 

                    //destFolder = replaceHexWithSpaces(destFolder);

                    //destFolder = URLEncoder.encode(destFolder, "UTF-8");

 

                    //URLEncoder.encode(destFolder, "ISO-8859-1");

                          httpclient = HttpClients.createDefault();

 

                           HttpPutput =new HttpPut(destFolder);

 

                           CredentialsProvidercredsProvider =new BasicCredentialsProvider();

                          

                          

                         StringsharePointUserId = PropertyUtil.getServerInfoProperty().getProperty("SP_USERID");

                         StringsharePointPasswd = PropertyUtil.getServerInfoProperty().getProperty("SP_PASSWD");

                         StringsharePointWorkStation = PropertyUtil.getServerInfoProperty().getProperty("SP_WORKSTATION");

                         StringsharePointDomain = PropertyUtil.getServerInfoProperty().getProperty("SP_DOMAIN");

                        

                         credsProvider.setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT) , new NTCredentials(sharePointUserId,sharePointPasswd ,""sharePointDomain ));

                        

                           HttpClientContextcontext = HttpClientContext.create();

                          context.setCredentialsProvider(credsProvider);

                           FileEntitycontent =new FileEntity(new File(srcFileName));

                          put.setEntity(content);

                      

                    response =httpclient.execute(put,context);

                    

                          responseCode =response.getStatusLine().getStatusCode();

                          

                          if(!(responseCode ==  HttpURLConnection.HTTP_OK  ||responseCode == HttpURLConnection.HTTP_CREATED)){

                                 

                                 retValue =responseCode+" ["+response.getStatusLine().getReasonPhrase()+"]";

                                 

                                  IDMLogHelper.debug(300040310L,"Error: Failed to export into SharePoint location at ["

                                                             + destFolder+"] and file ["+srcFileName+"]"+" : error message["+retValue+"]", Constants.FAILED);

                           }else{

                                 

                                 retValue=String.valueOf(true)  ;

                                  IDMLogHelper.debug(300040311L,"Success: Exported into SharePoint location at ["

                                               + destFolder+"] and file ["+srcFileName+"]" , Constants.SUCCESSFUL);                                

                           }

 

              }catch (Exceptione) {

                    

 

                  IDMLogHelper.debug(300040310L,"Error: Failed to export into SharePoint location at ["+destFolder+"] and file ["+srcFileName+"]"+" : error message["+e.getMessage(), "@httpclient.execute(put, context)]");

                  retValue = "404 [NOT FOUND] ["+e.getMessage() +"]";

                    returnretValue;

        }finally {

           try {

             if (response != null )  response.close();

             httpclient.close();

 

            }catch (Exceptione) {

             returnretValue;

            }

        }

 

             returnretValue;

       }


Getting 403 forbidden error in responseCode while connecting to Office 365 share point using java code

$
0
0

publicstatic String copySharepointLocation(StringsrcFileName, StringdestFolder)   {

              CloseableHttpClienthttpclient =null;

             intresponseCode = 0;

              StringretValue ="";

              CloseableHttpResponseresponse =null;

             try{

 

                    //destFolder = replaceHexWithSpaces(destFolder);

                    //destFolder = URLEncoder.encode(destFolder, "UTF-8");

 

                    //URLEncoder.encode(destFolder, "ISO-8859-1");

                          httpclient = HttpClients.createDefault();

 

                           HttpPutput =new HttpPut(destFolder);

 

                           CredentialsProvidercredsProvider =new BasicCredentialsProvider();

                          

                          

                         StringsharePointUserId = PropertyUtil.getServerInfoProperty().getProperty("SP_USERID");

                         StringsharePointPasswd = PropertyUtil.getServerInfoProperty().getProperty("SP_PASSWD");

                         StringsharePointWorkStation = PropertyUtil.getServerInfoProperty().getProperty("SP_WORKSTATION");

                         StringsharePointDomain = PropertyUtil.getServerInfoProperty().getProperty("SP_DOMAIN");

                        

                         credsProvider.setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT) , new NTCredentials(sharePointUserId,sharePointPasswd ,""sharePointDomain ));

                        

                           HttpClientContextcontext = HttpClientContext.create();

                          context.setCredentialsProvider(credsProvider);

                           FileEntitycontent =new FileEntity(new File(srcFileName));

                          put.setEntity(content);

                      

                    response =httpclient.execute(put,context);

                    

                          responseCode =response.getStatusLine().getStatusCode();

                          

                          if(!(responseCode ==  HttpURLConnection.HTTP_OK  ||responseCode == HttpURLConnection.HTTP_CREATED)){

                                 

                                 retValue =responseCode+" ["+response.getStatusLine().getReasonPhrase()+"]";

                                 

                                  IDMLogHelper.debug(300040310L,"Error: Failed to export into SharePoint location at ["

                                                             + destFolder+"] and file ["+srcFileName+"]"+" : error message["+retValue+"]", Constants.FAILED);

                           }else{

                                 

                                 retValue=String.valueOf(true)  ;

                                  IDMLogHelper.debug(300040311L,"Success: Exported into SharePoint location at ["

                                               + destFolder+"] and file ["+srcFileName+"]" , Constants.SUCCESSFUL);                                

                           }

 

              }catch (Exceptione) {

                    

 

                  IDMLogHelper.debug(300040310L,"Error: Failed to export into SharePoint location at ["+destFolder+"] and file ["+srcFileName+"]"+" : error message["+e.getMessage(), "@httpclient.execute(put, context)]");

                  retValue = "404 [NOT FOUND] ["+e.getMessage() +"]";

                    returnretValue;

        }finally {

           try {

             if (response != null )  response.close();

             httpclient.close();

 

            }catch (Exceptione) {

             returnretValue;

            }

        }

 

             returnretValue;

       }

How to build a URL to put behind a workflow start button

$
0
0

Hello,

I'm using SharePoint Online and I'm trying to build a button in a form designer, and to use to trigger an item workflow.

The button is there and this is the code I used behind it (provided by the form designer too provider):<input type="button" value="Approve"
onclick="myCustomFunctionName();return false;">

Or I can also make it a hyperlink.

However, my struggle is with composing the url behind the button or hyperlink. the URL to start the workflow for an item looks as follows:

https://servername.sharepoint.com/sites/NewTeamSite/HRPortal/_layouts/15/IniWrkflIP.aspx?List={d8fc16cb-c8e8-4dfd-a472-062f31cd4c5c}&ID=6&ItemGuid={B128A332-464D-44D2-B932-43DE732B590E}&TemplateID={dc92984f-28b5-4498-8354-87a57118b6a2}&Source=https%3A%2F%2Fmjft%2Esharepoint%2Ecom%2Fsites%2FNewTeamSite%2FHRPortal%2FLists%2FRequest%2520Leave%2FAllItems%2Easpx

This is the url on the Start Workflow page:

How should my URL behind the Approve button look like, so that it picks up the curent item ID? I presume it's some sort of variable or something like that, but I literally have no idea how to do it. I did some research on my own and I didn't find anything.

Could you please help me out?

Regards,

Alexandra


Alexandra Prisacaru

script permission denied error when using FQDN

$
0
0

Hi friends,

One of my user is facing a problem when trying to add a user from people picker using the FQDN url - nothing happens.

I used the IE browser developer tools and can see numerous errors in console "script[number] permissions denied" (looks like a problem with the user machine and the script is not loading). Moreover, the Lync status is also not displaying.

This works fine for other users and problem happening only when using the FQDN http://site.client.com, the short http://site works fine without any problem.

Any thoughts or suggestions are appreciated.

How to Create Custom List in SharePoint 2010 Programmatically ?

$
0
0
Hi,

i have tried the following way, 

http://devendra-sharepoint.blogspot.in/2012/01/creating-list-programatically-in_30.html

But i am not able to create list.

Becuase i am getting the following error.

'Microsoft.SharePoint.SPWeb' does not contain a definition for 'EnsureList' and no extension method 'EnsureList' accepting a first argument of type 'Microsoft.SharePoint.SPWeb' could be found (are you missing a using directive or an assembly reference?)

Please advice.

Thanks,
Aasai

list not found error when calling getList method

$
0
0

Hi All,

I have a Sharepoint integration in a vfp application. We create MSXML2.XMLHTTP objects and call Sharepoint web services in order to interact with sharepoint server.

Suppose I have a library called 'TestLibrary' in the site 'http://servername/subsite1/subsite2' in Sharepoint server. I can see 'TestLibrary' by using the internet explorer without any problem.

In our application, we are trying to check the library is available in the server, by calling the GetList() method in lists.asmx. Here what we are doing is pass the library to the web service  http://servername/subsite1/subsite2/_vti_bin/lists.asmx and call the method getList(). But the response text indicates the following error. But TestLIbrary is available on Sharepoint server and can access without any problem for the same user. Can anyone tell me why this happens?

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    List does not exist.
    The page you selected contains a list that does not exist.  It may have been deleted by another user.
    </errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000006</errorcode></detail></soap:Fault></soap:Body></soap:Envelope> 
Viewing all 11508 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>