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

SharePoint 2013 Client Side People Picker Search User In Specific Group

$
0
0

hi All,

I created people picker using CSOM. I want restrict people picker search to specific group. is that possible if yes please help me.

Thanks In Advance.


How can we attach a remote event receiver to a SharePoint online (office 365) site using CSOM in console app?

$
0
0

Hi,

I am developing a console application in which I have to attach a remote event receiver to a SharePoint online site. However, remote event receiver has been deployed using SharePoint provider hosted app on azure site, and it is up and running.

I am able to attach that RER to the site successfully through console app but RER is not triggering when I do any activity related to that event.

Refer below code for attaching the RER:

Site RootSite = clientContext.Site;
clientContext.Load(RootSite, pSite => pSite.EventReceivers);
clientContext.ExecuteQuery();

EventReceiverDefinitionCreationInformation eventReceiverInfo = new EventReceiverDefinitionCreationInformation();
eventReceiverInfo.EventType = EventReceiverType.WebProvisioned;
eventReceiverInfo.ReceiverClass = "WebProvisionedEvent";
eventReceiverInfo.ReceiverName = "WebProvisionedEvent";
eventReceiverInfo.ReceiverUrl = "https://test.azurewebsites.net/Services/WebProvisionedEvent.svc";
eventReceiverInfo.SequenceNumber = 10001;
eventReceiverInfo.ReceiverAssembly = AssemblyFullName;
RootSite.EventReceivers.Add(eventReceiverInfo);
clientContext.ExecuteQuery();

Any help would be appreciable...

Thanks,


Custom Application Page - ViewState is Null occasionally after postback

$
0
0

Hi All,

In our SP 2013 custom developement, we have an application page (aspx) to submit a registration details. Here we have option to add multiple entries at same time (dynamic table). so on page load we get all required datas from site and keep that in DataTable then saved that in ViewState. In our application we have nearly 3000 items in one of our master list, so get all 3000 items and save that in ViewState. we are using UpdatePanel in the application page.

In this case occasionaly i get ViewState is Null error on few postback. sometime this works fine. I am not able to figure out exact scenario.

Note: Same logic working in SP 2010 environment.

I have few questions from my side

1. Is there any different between SP 2010 & SP 2013 in the form of handling ViewState data?

2. Is there any limitation with ViewState size?

3. Is UpdatePanel cause any issues?

Pls let me know if any one of you face this kind of issue in SP 2013.

Displaying data from another list

$
0
0

Hi guys,

I have two list. The master and secondary. The master list only contains my clients data (e.g. 1000 items). Now in my secondary list I want to my user simply select client name (which feeds from the master list) and then populated other fields in the secondary list based (e.g. location) for the chosen client.

I know i can do this with InfoPath but i wonder if there is any better option (OOB preferably )? such as search query web part or even maybe some JavaScript.

See i have 100 client name so showing the 1000 client names in a drop down is not really clean...

If anyone has some ideas or experience that share with me that would be much appreciated.

Thanks

BalaiP

How do I delete or hide the "Name" column from a content type?

$
0
0

I have a content type that is inheriting from a folder content type, and another from the document set content type. Both of these have the "Name" field that is inherited. I do not need to use this "Name" field, and I would either like to delete or hide it from my content types. Is there a way to get this accomplished? 

Is there a way to do this through the UI or programmatically?

Slow performance when getting user properties

$
0
0

Hi, guys
I'm using the PeopleManager.getMyProperties method to get the properties for the logged in user. This works fine, but it's time consuming. I really need to get a better performance, but I'm at a loss.

I assume getMyProperties retrieves ALL user properties, which is a lot. Can I make it only fetch what I actually need to reduce the amount of data being sent over the network?

Or is the getPropertiesFor method a better option performance-wise?

This is an excerpt of my JavaScript code:

SP.SOD.executeFunc('SP.Taxonomy.js', 'SP.ClientContext', function(){
	SP.SOD.executeFunc('SP.UserProfiles.js', 'SP.ClientContext', function(){
		var clientContext = new SP.ClientContext.get_current();
		var peopleManager = new SP.UserProfiles.PeopleManager(clientContext);
		userProperties = peopleManager.getMyProperties();
		clientContext.load(userProperties);
		clientContext.executeQueryAsync(userObjectSucceded, userObjectFailed)

		function userObjectFailed(sender, args){
			console.log("GetUserObject (userObjectFailed): " + args.get_message());
		}

		function userObjectSucceded(){
			try {
				var accountName = userProperties.get_userProfileProperties()["AccountName"];
				var workEmail = userProperties.get_userProfileProperties()['WorkEmail'];
				var organization = userProperties.get_userProfileProperties()['Organization'];
				var firstName = userProperties.get_userProfileProperties()["FirstName"];
				var lastName = userProperties.get_userProfileProperties()["LastName"];
				currentUser = ({userid: accountName, email: workEmail, organization: organization, firstName: firstName, lastName: lastName});
			}
			catch (err) {
				console.log(err);
			}
		}
	});
});

Any information on the subject is appreciated. Thanks.

SharePoint Online People Picker

$
0
0

Hi,

How to use multiple people picker in same page and how to get the values from it.

Kindly assist me the way to do.

Get user role permission using REST

$
0
0

Hi,

I want to develop an app to check user permission.

Please help

Thanks


Unable to get property 'toUpperCase' of undefined or null reference

$
0
0

I am trying to check if document exist or not in a document library and using the following JavaScript, I get the 'Unable to get property 'get current' of undefined or null reference' error in the debugger.

<script type="text/javascript">


        function ValidateFile() {
            var fupload = document.getElementById("<%= fuMSSFile.ClientID %>");

            var filename = fupload.value;
            if (filename != '') {
                var lastIndex = filename.lastIndexOf("\\");
                if (lastIndex >= 0) {
                    filename = filename.substring(lastIndex + 1);

                    var DocLibName = '<%=MSSDocLibName%>';
                    var fileURL = '/' + DocLibName + '/' + filename;


                    $(function () {

                        SP.SOD.executeFunc('sp.js', 'SP.ClientContext', getFileExists);

                    });

                    //ExecuteOrDelayUntilScriptLoaded(getFileExists, "sp.js");

                    getFileExists(fileURL,
                        function (fileFound) {
                            if (fileFound)
                            { ConfirmUpload() } else { document.getElementById('<%=HiddenField.ClientID%>').value = 'N'; };
                        },
                 function (error) {
                      console.log(args.get_message());
                                 alert(args.get_message())
                                });

                }
                else { document.getElementById('<%=lblMsg.ClientID%>').value = "Please select file to upload" }
            }
        }


        function getFileExists(fileUrl, complete, error) {

            var ctx = new SP.ClientContext.get_current();
            //var ctx = SP.ClientContext.get_current();
            var file = ctx.get_web().getFileByServerRelativeUrl(fileUrl);
            ctx.load(file);
            ctx.executeQueryAsync(function () {
                complete(true);
            },
            function (sender, args) {
                if (args.get_errorTypeName() === "System.IO.FileNotFoundException") {
                    complete(false);
                }
                else {
                    error(args);
                }
            });
        }</script>

          



The reading I've done seems to indicate that this is a problem with sp.js loading after the getItem() function is called.

So I added the following line:

ExecuteOrDelayUntilScriptLoaded(getItem, "sp.js") & SP.SOD.executeFunc('sp.js', 'SP.ClientContext', getFileExists);

Which gets me a new error, this time in sp.js: "Unable to get property 'toUpperCase' of undefined or null reference."

I'm guessing that this is because the getItem () function is returning no data, but it's odd, because sp.js still seems to be loading afterwards -- that is,
I always get the 'get current' error first, then the 'toUpperCase' error.

Any suggestion


Modifying Announcement Email Template

$
0
0

Hi all,

I was wondering how you go about customising the announcement email template in SharePoint Online? I'd like to add a logo, change the font and layout etc etc and I just cannot find any info on how to do this for Online.

Any help and pointers always appreciated.

Thankyou,
Conrad



PowerShell for Document Library permissions

$
0
0

Hello, I have a Site Collection with many subsites.  Each subsite has a document library with the same name and would like to have the same unique permissions set.

To make it easy, the site collection is called Years

https://domain/sites/years/

subsites 2000, 2001...2016

so https://domain/sites/years/2016/Four Quarters/ there is a space (darn it) in each Document Library such as "Four Quarters"

Inherited permisisons should be be removed and then any permissiosn listed, should be removed and replaced with a few, such as "Domain Admins - Contribute" and "Domain Users - Read" for instance, on each Document Library (only one in each subsite).

I do NOT need to use something like this PowerShell below, however it MAY be helpful.  I do NOT know PowerShell and I saw this and wondered if it might help with getting the subsites, however, after that I don't know how to get the Document Library and then set the permissions.

start-transcript c:\PowerShellScripts\Proposals\dailyProposalstranscript.txt
rm c:\PowerShellScripts\Proposals\allsites.txt
rm c:\PowerShellScripts\Proposals\allsitesnq.txt
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
Get-SPsite -identity https://WebApplicationqa/depts/SiteCollection/ | get-spweb -Limit All | select url | export-csv -path c:\PowerShellScripts\Proposals\allsites.txt -NoTypeInformation

Get-Content c:\PowerShellScripts\Proposals\allsites.txt | % {$_ -replace '"', ""} | Set-Content c:\PowerShellScripts\Proposals\allsitesnq.txt
Get-Content c:\PowerShellScripts\Proposals\allsitesnq.txt |  Where { $_ -Match "https://WebApplicationqa/depts/SiteCollection/" } | Set-Content c:\PowerShellScripts\Proposals\allsites.txt

Thank you! Please let me know (obviously) if I need more information or if this isn't clear.

a site collection with subsites all with the same named document library need unique permissions set on it, there are permissions already on it, and they need to be removed and specific permissions applied for each subsite's Document Library named "xyz"

How to add document/image/video at local hard drive (any hard drive of computer) from sharepoint site?

$
0
0

Hi all,

I am using sharepoint 2013. I want to develop a web part which will provide a interface (for eg. a Browse functionality) which will accept any file like image, video, document and store that file in my local hard drive. Also I want to show this files on sharepoint site also. How can I do this?

Please suggest the workaround for achieving this.

Regards


amol

JSGrid Row Disable

$
0
0

Hi,

I use the JSGrid for a financial web part in Project Server 2013.But Although i wanted to disable of total row,this is not done.I tried to use RegisterCellStyle method.Unfortunately this method does not support the disabled attribute.It just supports textalign or background attribute. How can i do disable to total row or cell of total row?

How to set width of taxonomy field editor in custom layout page

$
0
0

I have a custom master page and layouts. In the layout I have an EditModePanel. Inside that I have included some managed metadata columns. My problem is that SharePoint is writing an inline style attribute to set the width of the div that contains this control. But it isn't able to fit both the text field and the 'browse for a valid choice' icon button on the same line, due to this inline style width attribute. This throws the spacing off completely with the title of the field then a new line under, with the small icon button to the far right, then on a new line is the text field. If I use the browser developer tools to delete the width="778px" then the text field and icon are on one line. I can't override with with my stylesheet because it is inline style which always takes precedence!

What is in my layout page:

<PublishingWebControls:EditModePanel runat=server id="EditModePanel1" CssClass="edit-mode-panel" SupressTag="True"><SharePointWebControls:TextField ID="TextField1" FieldName="Title" runat="server"></SharePointWebControls:TextField><SharePointWebControls:FieldProperty ID="FieldProperty1" FieldName="Title" PropertyName="Description" runat="server" /><SharePointWebControls:FieldProperty ID="FieldProperty3" FieldName="ReviewDate" PropertyName="Description" runat="server" /><Taxonomy:TaxonomyFieldControl ID="TaxonomyFieldControl1" FieldName="ContentKeywords" runat="server"></Taxonomy:TaxonomyFieldControl><Taxonomy:TaxonomyFieldControl ID="TaxonomyFieldControl2" FieldName="OrganisationalUnit" runat="server"></Taxonomy:TaxonomyFieldControl></PublishingWebControls:EditModePanel>

What gets rendered by SharePoint - notice the width="778px. I have a div around the editmodepanel which has width="800". So it appears SharePoint has some JavaScript that measures the width of the container above to then work out what to set as the inline width for this div. But is not making it small enough for both the text box and the icon to fit on the same line.

<div class="ms-formfieldvaluecontainer"><span dir="none"><span id="ctl00_PlaceHolderMain_EditModePanel1_TaxonomyFieldControl2_ctl00"><input type="hidden" id="ctl00_PlaceHolderMain_EditModePanel1_TaxonomyFieldControl2_ctl01" name="ctl00$PlaceHolderMain$EditModePanel1$TaxonomyFieldControl2$ctl01"><div class="ms-taxonomy ms-taxonomy-height ms-long" id="ctl00_PlaceHolderMain_EditModePanel1_TaxonomyFieldControl2_ctl02"><div id="ctl00_PlaceHolderMain_EditModePanel1_TaxonomyFieldControl2_ctl02controlHolder" class="ms-taxonomy-control-holder ms-long"><img src="/_layouts/15/images/EMMCopyTerm.png" title="Browse for a valid choice" alt="Browse for a valid choice" tabindex="0" class="ms-taxonomy-browser-button"><div class="ms-taxonomy-fieldeditor ms-taxonomy-fieldeditor-standard ms-taxonomy-disabled" title="Organisational Unit" style="width: 778px;"><span id="ms-rterangecursor-start" rtenodeid="1"></span><div contenteditable="false" id="ctl00_PlaceHolderMain_EditModePanel1_TaxonomyFieldControl2_ctl02editableRegion" class="ms-taxonomy-writeableregion ms-inputBox ms-rtestate-read" disableribboncommands="True" allowmultilines="false" restrictpastetotext="True"></div><span id="ms-rterangecursor-end"></span></div></div><div id="ctl00_PlaceHolderMain_EditModePanel1_TaxonomyFieldControl2_ctl02suggestionsContainer" class="ms-taxonomy-suggestion-container ms-rtefocus-invalid ms-taxonomy-hidden" unselectable="on"><div class="ms-taxonomy-suggestion-holder" unselectable="on"></div><img src="/_layouts/15/images/CornerGrip.gif" unselectable="on" class="ms-taxonomy-panel-resizer"></div></div></span></span></div>
So how can I get around this limitation of SharePoint?

SharePoint 2013 ( client object model) Quick Launch option is not enabling

$
0
0

hi all,

  I Am using client object model code to create a SharePoint List.List creation is working fine but list is not adding to quick launch.

            ClientContext clientContext = Getauthenticatedcontext(SiteUrl);
                if (clientContext != null)
                {
                    Web web = clientContext.Web;
                    ListCreationInformation myListCreationInformation = new ListCreationInformation();
                    myListCreationInformation.Title = ListName;
                    myListCreationInformation.TemplateType = ListType;
                    myListCreationInformation.Description = ListDescription;
   myListCreationInformation.QuickLaunchOption = QuickLaunchOptions.On;
                    List list = web.Lists.Add(myListCreationInformation);
                    clientContext.ExecuteQuery();
}

Can anyone please suggest a way to enable QuickLaunch option using ClientObjectModel code.

Thanks in advance

Regards,

Vysa


Search - saving user preferences

$
0
0

Hi,

Is it possible to save user's search preferences while implementing a search platform in SharePoint 2013?

In my search platform there are a number of metadata fields in the refinement panel that the user chooses for filtering out the search results. Is there a way I can save these values as preferences and apply them the next time the users fires a search?

Cutoo

REST create list item with Person field that allows multiple names

$
0
0

Can anyone please advise: we are using REST to create list items and have done several of these. This is the first time we are attempting to create a list item with a Person or Group field that allows multiple names. I understand the field expects Collection(Edm.Int32) so we created an object with the IDs of all the users. Passing this in, however, continues to give us the error:

A node of type 'StartArray' was read from the JSON reader when trying to read a value of a property; however, a 'PrimitiveValue' or 'StartObject' node was expected.

Our jQuery function that creates is below.  We use the same one for forms with single Person fields without issue.

function createSPListItem(url, listName, itemFlds, success, failure) {
    try {
        var postURL = url + "/_api/web/lists/getbytitle('" + listName + "')/items";


        $.ajax({
            url: postURL,
            type: "POST",
            contentType: "application/json;odata=verbose",
            data: JSON.stringify(itemFlds),
            headers: {"Accept": "application/json;odata=verbose","X-RequestDigest": $("#__REQUESTDIGEST").val()
            },
            success: function (data) {
                success(data);
            },
            error: function (data) {
                failure(data);
            }
        });
    } catch (err) {
        formError(arguments.callee, err.toString());
    }
}

Our Payload looks like:

{"__metadata":{"type":"SP.Data.OurListItem"},"RequestorId": [106,111],"Title":"pn","Phone_x0020_Extension":"25283","DirectorId":1,"Project_x0020_Details":"pn","ContinueWith":"i","CompleteDate":"03/09/2016","AssignedToId":null,"Phase":"New","Status":"Green"}


- Thank you. Respectfully, Janette M. Ricker

Infopath 2013 error - Not Enough Storage is Available to process this command

$
0
0

Hi Experts,

I am working with Signature Collection Workflow with SharePoint Designer 2013 and trying to modify Task form for one of the workflow. It has been irritating experience to use InfoPath designer as I kept getting below error again and again. Please help its so annoying. I cant continue with my work.


Abhijeet Khopade

Document Set Modified By and Modified Date are getting updated to Current System Date and System Account automatically

$
0
0

Document Sets Modified By and Modified Date are getting changed to Sytsem Account and System Date respectively once a specific OOTB Timer Job named "Document Set Template Update Job"gets executed. It changes these values for document sets only but it does not change anything to the documents which are part of those document sets.

We want to preserve the actaul values of modified by and modified date at Document Set level as well.

This is only happening to those document libraries which have been created using a custom document library template.

After creating the document library using the custom library template, we are also adding Document Set and one more custom Content Type to it.

Can we prevent this happening ?

Thanks in advance.


Thanks, Bhadr :) Mark as Answer if it solves your problem. Vote As Helpful if the post is helpful for you.

Convert words in a library to PDF automatically

$
0
0
Is there a way to convert words in a library to PDF automatically using a workflow or code?

Ron Johnson Systems Administrator Michigan State University Federal Credit Union Office – (517) 333-2391 ron.johnson@msufcu.org WWW.MSUFCU.ORG

Viewing all 7589 articles
Browse latest View live


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