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

Web Part is not visible in Web Part gallary

$
0
0

Hi,

I have developed a project in sharepoint having two web parts inside it.

Initially, when there was only one web part in my project it was working fine. But suddenly when i added a new web part, it is not showing me web parts in a gallary. Event it is not available in web part list under Web Designer Gallaries.

I tried with old .wsp to deployed, but still the same problem.

On my development machine it is working with two web parts very good. but when i try to deploy that wsp on production site, it is not showing me anything in web part gallary while it was when i was working with one web part only in my project.

Please, direct me where i am doing wrong, any possibilities?

I did workarounds as

1.  Check for the custom webpart feature folder under 14\TEMPLATE\FEATURES ----- Yes it exists there

2. If the feature Scope is Site

3. The webpart dll is deployed to GAC with Stsadm command

4. No web part(My Custom) found here Site Action > Site Settings > Galleries > Web Parts



Sharepoint 2013, event receiver to rename files not working

$
0
0

I coded an event receiver (ItemAdding) that renames for example a .txt file to a .text file (it does not matter the extensions, it is just an example). In my code what I do is to an SPFile.MoveTo operation. It works fine in SP2010 but when I execute the same code in SP 2013, when the operation is done using IE I get the text "Sorry, something went wrong" and then "File Not Found".

In the logs this is what I see:

12/23/2013 15:48:49.16  w3wp.exe (0x17B0)                        0x0AC8 SharePoint Foundation         General                        ai1wu Medium   System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002), StackTrace:    at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, SPBasePermissions& permMask)     at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean throwException)     at Microsoft.SharePoint.SPFile.get_Length()     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadPage.OnSubmit(Object o, EventArgs e)     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadExPage.OnSubmit(Object o, EventArgs e)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessReque... f72b639c-77b1-5045-c3a2-b23f24ae71c0

It's clear that the Sharepoint upload code tries to do things with the original name and it does not realize that it was renamed.

Can I do something from my event receiver code like using the AfterProperties to bypass this error?

Thanks

Office 365 - SharePoint Online - dev of site columns / content types

$
0
0

I have an Office 365 E3 subscription (with already a development site created). What are my options for creating site columns / content types (at site collection level) using Visual Studio 2013? Obviously when using the SharePoint 2013 project I need to have a local instance of SharePoint Foundation/Enterprise installed.

Thanks.

Microsoft.SharePoint.SPException while trying to check out a document via REST API

$
0
0

So I am trying to check out a document in Sharepoint 2013 via the REST API.

I am hitting the following endpoint:

http://win-5a8pp4v402g/sharepoint_test/site_1/_api/web/GetFileByServerRelativeUrl('/sharepoint_test/site_1/Documents/file1.txt')/checkout

However in the response I get this:

{"error":{"code":"-2130575251, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again."}}}

However when I am manually checking out the same document in the browser, it works pretty well.

I looked here for a solution, but it doesnt apply in the case of check out via REST API.

Please help.


How to edit an existing page in SharePoint designer and add custom javascript

$
0
0

When I edit an existing page in SharePoint Designer to add JavaScript and save, I get a dialog with message

"Content in the embedded form field may be changed by the server to remove unsafe content. Do you want to reload you page to see the results of the save?"

When I click OK it reverts my change. How do I add custom JavaScript to the page?


Pragmatically Backup and restore a site collection

$
0
0

Hi,I'm going to restore a site collection pragmatical. So when user click the CreateNewClient button, It should restore a new site collection named Site1. ( this site collection doesn't exist)

Here is the code:

#region CreateNewClient3
        protected void CreateNewClient3_Click(object sender, EventArgs e)
        {
            try
            {
                string sitecollectionURL = "http://ad/sites/site1";
                string backupfilename = @"E:\\Clientn.bak";
                SPWebApplication parentWebApp;

                using (SPSite siteCol = new SPSite(sitecollectionURL))
                {
                    parentWebApp = siteCol.WebApplication;
                }

                parentWebApp.Sites.Restore(sitecollectionURL, backupfilename, true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        #endregion 

and for backup:

#region Backup  
        protected void Backup_Click(object sender, EventArgs e)
        {
            try
            {
                string sitecollectionURL = "http://ad/sites/ClientTest";
                string backupfilename = @"E:\\Clientn.bak";
                SPWebApplication parentWebApp;

                using (SPSite siteCol = new SPSite(sitecollectionURL))
                {
                    parentWebApp = siteCol.WebApplication;
                }

                parentWebApp.Sites.Backup(sitecollectionURL, backupfilename, true);   
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            
            
        }
        #endregion

Backup is working fine but Restore button doesn't work and I get the following error:

The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

I login with administrator (Full permission) and    I've checked web.config :   trust level="Full"

<trust level="Full" originUrl="" legacyCasModel="true" />
    <webParts>

but I still get Access denied 

Could you please advise me?

Thanks


How to get the name of the Folder ,Modified and Modified by in share point Library using web service ? please help !

$
0
0

hi all,

How to get the name of the Folder ,Modified and Modified by in share point Library using web service ?

how to write that web service and where should i deploy it ?

also , i need to get a path of the file whenever that file is uploaded inside share point server[inside library , lists anywhere] using a web service..

i need to pass that path to a web service so that i can display that path inside micro soft CRM.

thank you,

Jay


SSRS report on SharePoint list and CAML, filter by person or group field with multiple entries

$
0
0

I would like to ask how can we input multiple people name in SSRS report to filter the data from a SharePoint multiple entries person and group field by CAML query.

We have a SharePoint list with a multiple entries person or group field, e.g.

|Title|Users|
|Item 01|User A, User B, User C|
|Item 02|User A, User C|
|Item 03|User D, User C|
|Item 04|User D, User E|

When user input parameter "User A, User C", should return item 02.

When user input parameter "User C", should return item 01, 02 and 03.

Following is my CAML in my dataset:

<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ListName>Cases</ListName>
  <ViewFields>
    <FieldRef Name="Title" />
    <FieldRef Name="Users" />
  </ViewFields>
  <Query>
    <Where>
      <Contains>
        <FieldRef Name="Users" />
        <Value Type="Text">
          <Parameter Name="Users" />
        </Value>
      </Contains>
    </Where>
  </Query>
</RSSharePointList>


Set group owner using REST API

$
0
0

I'm trying to use the REST API to set the owner of a SharePoint group. I can successfully create the group using REST, but I can't change the owner. I've tried the following.

1 - Specifying a group owner while creating the group

Endpoint: .../_api/web/sitegroups
Method: POST
Headers:
Content-Type: application/json; odata=verbose
Body:
{ '__metadata': { 'type': 'SP.Group' }, 'Title': '<title>', 'Description': '<description>', 'Owner': { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}}

This returns a 500 error: "The specified name is already in use. Please try again with a new name". In other words, the owner title I specified already exists, which is correct - I'm trying to make an existing principal the owner of the new group.

2 - Merging a new group owner into an existing group

Endpoint: .../_api/web/sitegroups(<group_id>)
Method: POST
Headers:
Content-Type: application/json; odata=verbose
X-HTTP-Method: MERGE
Body:
{ '__metadata': { 'type': 'SP.Group' }, 'Owner': { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}}

This returns a 500 error with a Microsoft.SharePoint.SPException: "Exception from HRESULT: 0x80131904". The trace logs don't shed any light on it.

3 - Using the owner endpoint directly

Endpoint: .../_api/web/sitegroups(<group_id>)/owner
Method: POST
Headers:
Content-Type: application/json; odata=verbose
X-HTTP-Method: PUT
Body:
{ '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}
This throws various 400 errors. If the current owner of the group is a user, I get the error "The required property 'Email' does not exist in the message" - i.e. it wants SP.User properties. If the current owner of the group is another group, I get the error "The required property 'AllowMembersEditMembership' does not exist in the message." - i.e. it wants SP.Group properties.

I've tried various adaptations of the three approaches above, such as specifying additional SP.Principal properties or passing SP.User or SP.Group objects instead, but with no success. Any ideas?

CSWP Display Template Item - Include Like / Rating SharePoint control

$
0
0

I'm working with the Content Search Web Part to bring details from Announcements lists up to the home page.  Each of these lists has the Like / Rating Social elements enabled and I would like to surface this on the Item Display Template but can't find out how.

Is there a SharePoint control or JavaScript that I can use to surface this content?

Thanks

List View Threshold for Auditors and Administrators - Which Kind of users

$
0
0

Hello ,

  I need to know about "Threshold for Auditors and Administrators"  for which kind of users ?

  I have a user that I add to a share point group that has "Full Control" permissions .

  But this user read the value from "List View Threshold"  not from "Threshold for Auditors and Administrators" .

  Thanks,


ASk

How to enable rating star in sharepoint 2013 programmatically

$
0
0
i want to enable rating star on a document library in sharepoint 2013, i used the way workings in sharepoint 2010,but it failed,can anyone show me?TKS in advance.

SocialCommentWebPart Alternative ?

$
0
0

Are we still stuck with the SocialCommentWebPart in SharePoint 2013 ?

I want the users to be able to comment news articles (publishing pages) etc in the same ways as in mysite.

Threaded with mentions hashtags etc.. 

What am i missing ? :) I have looked at all the available webparts i think.., and can't really find anything suitable..

SocialCommentWebPart is ancient, and it breaks the markup when the document mode is set to html5.

Anyone ?

Cannot connect to the targeted site in Visual Studio 2012

$
0
0

Hi,

I am trying to access SharePoint 2013 "qa" sites from development server. When I try to build Visual studio projects,  I am keep getting this below error.

"Cannot connect to the targeted site. This error can occur if the specified site is not hosted on the local system. SharePoint solutions work only with locally-installed versions of SharePoint Foundation or SharePoint Server. Remote development is supported only for apps for SharePoint 2013."

I tried to change the host file, with the current machine IP address and all. Not successful on that.

Highly appreciated, for any helpful points here.


Cheers, R.

SharePoint 2013 Provider-Hosted App Installs, throws File Exists error.

$
0
0

I have a SP2013 Provider-hosted app with DevExpress controls that was working fine until just recently. I am getting the following error when I try to F5 DEBUG:

"Error occurred in deployment step 'Install app for SharePoint': The file exists."

The app actually installs and executes but the debugger detaches very quickly plus it is prompting with the nagging aforementioned message. There are no AppUninstall / AppInstall / AppUpgraded events being handled.

Thanks in advance.


List View Threshold for Auditors and Administrators

$
0
0

Hello ,

  •    I have a List that has 3000 items .
  •    I set  "List View Threshold = 2500"  and "List View Threshold for Auditors and Administrators = 3500".
  •    I have a user that is in "Owner Group" that has "Full control" permission.
  •    When I logined by the user and open the list . I get error 

              "This view cannot be displayed because it exceeds the list view threshold (2500 items) enforced by the

                 administrator."

  • So what is "List View Threshold for Auditors and Administrators" for ? What Kind of users that use this property ?

       Thanks


ASk

Getting data from Oracle database to SharePoint list

$
0
0
I want to extract data from Oracle database to a SharePoint 2013 list, I have the connection url and the username and password;
jdbc:oracle:thin:username/servername@IPaddress:port/DatabaseName
How can it be done?

Restricting Modified Date value with System Account

$
0
0

Hi,

We have a document library called testdoc.

Now requirement is not to update 'Modified Date' whenever System Account updates the column.

Basically Modified Date is default sharepoint column where it is updated if document is modified by any user?

Now please let me know how to restrict the same if System Account modied any file in the document library?

Regards,

Sudheer


Thanks & Regards, Sudheer

2007 -> 2013 Upgrade .webpart and .dwp's

$
0
0

I recently did an upgrade from 2007 to 2013.  The content database is in 2013 version and the site collection has been upgraded to 2013.

But what we are noticing is that even after I reactive 2013 Publishing on every site/web the webparts in the webpart gallery are still referrencing version 12 of the sharepoint dll's.

E.g. The content query webpart did not show up in content rollup.  It's in the Default group and it's type is referencing version 12.  So I deleted the .webpart for it and reactivated publishing and poof the COntent Query Webpart showed up where it's suppose to and it works now.

Then on a whim I made a tool download all of the .dwp and .webpart files from the webpart gallery and used a search tool to scan them for version 12 references.  I found this list:

AuthoredListFilter.webpart

BusinessDataActionsWebPart.dwp

BusinessDataAssociationWebPart.webpart

BusinessDataDetailsWebPart.webpart

BusinessDataFilter.dwp

BusinessDataItemBuilder.dwp

BusinessDataListWebPart.webpart

CategoryResultsWebPart.webpart

CategoryWebPart.webpart

contactwp.dwp

ContentQuery.webpart

DateFilter.dwp

FilterActions.dwp

IViewWebPart.dwp

Microsoft.Office.Excel.WebUI.dwp

OlapFilter.dwp

owa.dwp

owacalendar.dwp

owacontacts.dwp

owainbox.dwp

owatasks.dwp

PageContextFilter.webpart

QueryStringFilter.webpart

RssViewer.webpart

SearchHighConfidence.webpart

siteFramer.dwp

SpListFilter.dwp

SummaryLink.webpart

TableOfContents.webpart

TasksAndTools.webpart

TextFilter.dwp

ThisWeekInPictures.DWP

TopSitesWebPart.webpart

UserContextFilter.webpart

WSRPConsumerWebPart.dwp

My question is.... Is there a way I can upgrade these to 2013.  I know that some of these won't have 2013 versions, but I can see 3 right of the bat that do.  Is there a way to get the publishing feature to overwrite them?  Or someone bench these to a sub folder or something?

I'm looking for the right way to do this, I could just delete them all and reactivate everything and see what shows up, but then I might me missing .webpart/.dwp's that are still needed.


My Blog: http://www.thesug.org/Blogs/ryan_mann1/default.aspx Website: Under Construction

find hidden column value in a dynamacally bind html table with Sharepoint list - Javascript

$
0
0

I have following code. Now I want to get the hidden column value based on user selected row. I also want to highlight the entire row, not only the e.target.
Can someone please help me.

function getTermdetailsQuerySuccsess(sender, args){var listEnumerator =Termsitems.getEnumerator();var datatable = document.getElementById("TermList");while(listEnumerator.moveNext()){var oListItem = listEnumerator.get_current();//var firstName = listEnumerator.get_current().get_item('Title');//var secondName = listEnumerator.get_current().get_item('LastName');var termID = listEnumerator.get_current().get_item('ID');var startdate = listEnumerator.get_current().get_item('startdate');var enddate = listEnumerator.get_current().get_item('Enddate');var termtype = listEnumerator.get_current().get_item('TermType');varHours= listEnumerator.get_current().get_item('Hours');varEdNone= listEnumerator.get_current().get_item('EdNoned');varSpecialty= listEnumerator.get_current().get_item('Specialty');varSubspecialty= listEnumerator.get_current().get_item('Subspecialty');varHospital= listEnumerator.get_current().get_item('Hospital');var DEMT = listEnumerator.get_current().get_item('DEMT');varSupervisor= listEnumerator.get_current().get_item('Supervisor');

        rowcount = rowcount +1;
        $("#TermList").append("<tr style='border-bottom:1px silver solid' align='middle'  class='gradeA'>"+"<td align='left' style='display:none'>"+ termID +"</td>"+"<td align='left'>"+ startdate +"</td>"+"<td align='left'>"+ enddate +"</td>"+"<td align='left'>"+ termtype +"</td>"+"<td align='left'>"+Hours+"</td>"+"<td align='left'>"+EdNone+"</td>"+"<td align='left'>"+Specialty+"</td>"+"<td align='left'>"+Subspecialty+"</td>"+"<td align='left'>"+Hospital+"</td>"+"<td align='left'>"+ DEMT +"</td>"+"<td align='left'>"+Supervisor+"</td>"+"</tr>");}}

 $('#TermList').click(function(e){var tr = $(e.target).parent().index();
        alert(tr);
        alert($(e.target).text());// using jQuery//  var Cells = tr.e.getElementsByTagName("td");

        $(e.target).addClass('row-highlight');var confirmationM = confirm("Do you want to edit this term deatils ?");if(confirmationM ==true){
            confirmation ="You pressed OK!";}else{
            confirmation ="You pressed Cancel!";
            $(e.target).removeClass('row-highlight');}});


 $('#TermList').click(function(e){var tr = $(e.target).parent().index();
        alert(tr);
        alert($(e.target).text());// using jQuery//  var Cells = tr.e.getElementsByTagName("td");

        $(e.target).addClass('row-highlight');var table = $("#TermList")[0];var cell = table.rows[tr].cells[1];
        alert(cell);var confirmationM = confirm("Do you want to edit this term deatils ?");if(confirmationM ==true){
            confirmation ="You pressed OK!";}else{
            confirmation ="You pressed Cancel!";
            $(e.target).removeClass('row-highlight');}});


d.n weerasinghe

Viewing all 7589 articles
Browse latest View live


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