28

It extracts one named parameter from the QueryString (URL) http://domainname.com/page.aspx?parameter1=xxx&parameter2=yyy var value=getQueryStringParameter('parameter1'); It is used in many examples and most of the time not necessary (and bloats your code) because SharePoint has multiple implementations in core libraries Usage depends on whether you ...


10

All you need to do is pass the Source parameter on the Query String. When the EditForm closes, it will always redirect to the page indicated in that parameter. For example: http://mysite/Lists/EditForm.aspx?ID=1&Source=http://mysite/default.aspx


9

I just realized that you are using the Search API. The example below is for basic SharePoint REST API. The following works for search: Created>2014-01-01-T00:00:00 So for your case: var queryUrl = "http://mydomain.com/sites/blabla/_api/search/query?querytext='ContentType:Factsheet RMExpiryDate>2014-05-30'&rowlimit=500&SelectProperties='...


6

This blog post from Microsoft is highly linked to and describes what you want to do. I've used it before, these days I typically use jQuery and SPServices. Setting lookups typically requires you to pass in the Lookup ID value or the ID;Descriptor. Here's an actual example from a site of mine, it's setting a person/group field, not a lookup though. You ...


6

The Office Dev Patterns and Practices repo on GitHub has a great sample for provisioning custom web parts on the host web from inside of an app which should be a viable option for your situation. You could use this pattern to allow users to retrieve a custom configured web part and have it inserted into their host web allowing them to insert it at will (you ...


4

To avoid this, use CAML query and post it in the request body. Use a CAML query builder to build the query. This doesn't have restrictions on the length. This might become long and repetitive. But AFAIK, there is no other way to post huge request bodies in the request URL. CAML query: <Query> <Where> <Or> <Eq> <...


4

var d=$(this).attr("ows_Date"); var date=new Date(d); alert((date.getMonth() + 1) + '-' + date.getDate() + '-' + date.getFullYear())


3

The answer is: HttpContext.Current.Request.QueryString Also make sure your page inherits from either LayoutPageBase or UnsecuredLayoutPageBase which are the base classes for application pages.


3

Use javascript by adding a Content Editor to the page or adding it to the markup itself. I did something similar, picked up ContactId from Query String. Picked up this code from here <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript"> jQuery(document)....


3

In JavaScript, there is a native SharePoint function called replaceOrAddQueryString(url, key, value) and returns the url. Ex: SP.Utilities.UrlBuilder.replaceOrAddQueryString("http://mysite", "level", "2") will return : http://mysite?level=2 SP.Utilities.UrlBuilder.replaceOrAddQueryString("http://mysite?level=2", "sublevel", "1") will return : http://...


3

If you want to manually navigate to the doc set, here's the correct URL: [site]/Applications/Forms/Application/docsethomepage.aspx?ID=4&FolderCTID=0x0120D52000097B2AAED9957E4CAD8855E43B2B0C6F00341030E5B70A6A4D9C605B8C48983359&List=3d911efd-eed7-4019-86c3-ed109b796891&RootFolder=[site]%2FApplications%2FTest%20app%202&RecSrc=[site]%...


3

You also need to expand the property inside the ListItemAllFields as ListItemAllFields/ArticleStartDate. The full url would be somewhat as below: _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetFolderByServerRelativeUrl('Pages/HomepageNews')/Files?$select=Author/Title,Title,ArticleByLine,TimeCreated,ServerRelativeUrl&$expand=Author,ListItemAllFields,...


3

You would have to overwrite the Save Action using PreSaveAction() in order to look at the Source, because how I understand it, Source is ignored if IsDlg is present.


2

The XSLTListViewWebPart can read querystring parameters, you could try this: .../Forms/AllItems.aspx?FilterName=Title&FilterMultiValue=*something* FilterName is a column. Hope this helps


2

I want to be able to show the same list item in different info path forms. IE one for initial creation, one for updating, one for the director to review, one for looking back on. Theoretically, this should have been controlled through GUI of Infopath Webpart properties pop-up dialog that has "Views:" drop-down list but practically it has always only one ...


2

You need to replace L&M with L&amp;M One way to do this is to use HttpUtility.HtmlEncode


2

As far as I know you can't, there is no built in OOB solution for this (at least not in 2010). What you can do instead is to use jQuery and some JavaScript, like this: $(function() { var fields = {}; $('.ms-formbody').each(function() { var name = $(this).html().match(/FieldInternalName="([A-Za-z0-9]+)"/); if (name) fields[name[1]] = $(this)....


2

Use %26 instead of &. It helped me. Like here: <Edit>_Layouts/project/custom Form.aspx?PageMode=Edit%26WFTask=1</Edit>


2

Problem solved by adding a Choice Filter webpart on the page (hidden) with the same values that you use in the querystring. The 2nd filter webpart captures the querystring value.


2

My first guess is, have you specified redirect url while registering your app in appregnew.aspx page? For more info check this link Basically what is happening is when you use bookmark to navigate to your app, the context token has expired. So you need to redirect to sharepoint site first to re-authenticate. Hope this helps.


2

You can use CSOM or SPServices to get the current user. To use SPServices, you need to include the JQuery and the SPServices scripts. var thisUsersValues = $().SPServices.SPGetCurrentUser({ fieldNames: ["Title", "Email"], debug: false });


2

You can apply only one filter on the Column using Query String. To achieve this what you can do is create a Calculated Column of Type Date and say =Created. So you will have the same date as the Created Column. Then you can filter ">" on one column and "<" on the calculated column or vice versa


2

Based on your requirements I understand that you have to open a modal window with list documents associated with the person in the MyPerson list. To achieve this you can make following changes. Change to the calculated column with hyperlink The link should be formatted as follows <a href="javascript:openPopup('" + personname + "')">show my docs</...


2

If you have a Visual Web Part and placed it in a page called http://myspsite/pages/WebPart.aspx then form the url with passing the Query String Parameter like http://myspsite/pages/WebPart.aspx?MyParam=test then to get this value from web part page PageLoad function call string myParam = Request.QueryString["MyParam"]; this will give you the passed ...


2

Use Request.QueryString to get querystring. Request.QueryString["parameter1"]; Build your query with dynamic values. Sample code: Server side object model: SPQuery query = new SPQuery(); query.Query = @"<Where><And> <Eq><FieldRef Name='ProjectCode' /><Value Type='Text'>"+...


2

It appears "ValidateInputIfRequiredByConfig" is a method in the .net framework. You can view the implementation of this method at https://referencesource.microsoft.com/#system.web/HttpRequest.cs,3ed0fe4075d2649a It refers to the httpRuntime section in the web.config and updating web.config as below should possibly resolve the issue. <system.web> ...


2

GetUrlKeyValue function in SharePoint is defined in init.js. If the key is not found in the specified URL then it returns an empty string(""). So, you can check it simply like below: if(xid) { alert("Found."); } else { alert("Not Found"). } Or if(xid == "") { alert("Found."); } else { alert("Not Found"). }


1

your code is giving me a headacke ;) use the JS object model! SP.UI.ModalDialog.showModalDialog(options); example: aspx: this is a button, you could have some other form of input type. <input type="button" value="Ok" onclick="opendialogNow(); return false;" /> the above calls this js method below: <script type="text/javascript"> SP.SOD....


1

Will this work for you? <asp:LinkButton runat="server" ID="lbJan" OnClick="lbMonth_Click" Text="ClickMe' CommandArgument="1" > protected void lbMonth_Click(object sender, EventArgs e) { string redirect = "<script>window.open('/Pages/Page1.aspx?sID=" + e.CommandArgument.ToString() + "' );</script>"; Response.Write(redirect); }


1

Hi Mark it's hard to find documentation for this but at the end I resolved using this pattern: resultspage.aspx#Default={"k":"*","r":[{"n":"owstaxIdYourManagedProp","t":["cf32e33f-7ca2-470d-956b-29368e54e736"],"o":"OR","k":false,"m":{"cf32e33f-7ca2-470d-956b-29368e54e736":"TermName"}}]} It's important to note that: k:* basically it means "all documents" ...


Only top voted, non community-wiki answers of a minimum length are eligible