10

It is not supported to retrieve versions for a List Item via REST/CSOM APIs, but there are alternative options. Using Versions.aspx application page The idea is to perform a get request to Versions page : http://<server>/<site>/_layouts/versions.aspx?list={litsID}&ID=<itemID> and extract versions info from page content as ...


9

I think I found a solution for appWebUrl. ssdar's answer gave me the same problem as I initially had with loading different pages, but another answer in the thread they linked to contained an answer that led me to the right path. Instead of: var appWebUrl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl')); var hostUrl = decodeURIComponent(...


8

I don't know of a configuration setting that will turn off the Add button in the Calendar but you can hide it by placing a Content Editor web part on the page and adding the following CSS to the Content Editor. Be sure to click the Edit Source button in the ribbon and paste it in the HTML Source. <style type="text/css"> .ms-acal-rootdiv A[title="...


8

Just hiding/removing +Add button, does not prevent the user from creating calendar Events using Calendar View, since the Events could be created by clicking inside calendar area. So, if you are interested not only in hiding/removing +Add button you could consider the following approach. How to disable the calendar events Example 1 ...


7

If it is indeed what the Related Item brings back, then it's just a normal json object and you can do this: var obj = [{"ItemId":2,"WebId":"860915f4-6bb7-4954-ae3a-dfb360620954","ListId":"4ba4d24a-4774-485b-8954-92794088f690"}]; var id = obj[0].ItemId;


7

The problem is that you are using the method getDay(). That method will give you the day of the week in this case 3. You should be using the method getDate(). var dt = new Date(dtTest.getFullYear(), dtTest.getMonth(), dtTest.getDate()); -Hope it helps.


7

Can you not use _spPageContextInfo? It has the current user ID built in: _spPageContextInfo.userId https://social.technet.microsoft.com/wiki/contents/articles/29766.sharepoint-understanding-the-sppagecontextinfo-object.aspx


7

Microsoft has said that SPFx was really designed for SharePoint Online, but it will be available in SharePoint 2016--but nothing on SharePoint 2013. Here is an article that explains (in the comments)... https://blogs.office.com/2016/05/04/the-sharepoint-framework-an-open-and-connected-platform/ https://dev.office.com/sharepoint/docs/spfx/known-issues-and-...


7

If I am not wrong, you want to group the list item with the column ids as displayed in the below image: In order to achieve this, please follow the following link: https://piyushksingh.com/2016/11/21/retrieve-grouped-listitems-sharepoint/ So in this link, both CSOM and JSOM code snippets are available.


6

No, audiences are not supported in the SharePoint client object model. Its only supported in the Server Object Model. In the past I created a Web Service in SharePoint that could take a user name and return the audiences for that user, leveraging the Server Object Model...but that approach probably doesn't work in your scenario.


6

First off we needed a page to work on, we could make a request to find default home page, or try document.referrer, but for now we can say it was /SitePages/Home.aspx (we call it variable page). For the sake of the examples we will say that appWebUrl and hostWebUrl are defined (these are available in querystring). Lastly we needed a link to the malicious ...


6

AppOnlyPolicy is not applicable to SP Hosted app as it uses OAuth tokens. You have to give user permission to make this work. According to MSDN: Apps that do not make OAuth authenticated calls (for example, apps that are only JavaScript running in the app web) cannot use the app-only policy. They can request the permission, but they will not be able to ...


6

Ok, this is an issue with the settings for your tenant. Basically, to test this you can try to upload a document to the Style Library from the UI. You should be getting the same access denied. How to solve this? Go to the SharePoint administration page for your tenant. Access the Settings page (last item of the left navigation). Locate the section "Custom ...


6

To access information in the host web using the Javascript Object Model you need to use an SP.AppContextSite object in conjunction with your SP.ClientContext I see you're using TypeScript, which is awesome, so I'll post my answer with both TypeScript and the working Javascript; my comments will have some additional information and you can paste the JS ...


6

A SharePoint-hosted App (aka SharePoint-hosted Add-in) cannot embed C# code. It's made of JavaScript only code. The other kind of Apps (Provider-hosted App) may use C# code, but that code will run on a third-party server (and could use C# client API for SharePoint, as well as the identity of the initial user, if the App is used in Office 365 and thus ...


5

You need to reference following JavaScript file: <SharePoint:ScriptLink ID="ScriptLink2" name="SP.UserProfiles.js" runat="server" ondemand="false" localizable="false" loadafterui="true" /> Than you can access the User Profile Properties as follows: var personProperties; // Ensure that the SP.UserProfiles.js file is loaded before the custom code ...


5

SP.UI lives on another file, that is sp.ui.dialog.js You need to add it to the script references <script type="text/javascript" src="_layouts/15/sp.ui.dialog.js"></script>


5

The only possible option seems that you have to write some tricky codes. Follow the below steps: Write JSOM and Get all items in JavaScript Array. Apply Group By functionality Count the Similar items Display the count. For group by and counting using JavaScript, you can refer How do I do a array group and count it


5

If you are finding it difficult to debug your remote event receiver, most probably you would be using an incorrect connection string to connect to the Microsoft Azure Service Bus. Visual Studio Error List will show “Cannot register Services/RemoteEventReceiver1.svc on Microsoft Azure Service Bus: The remote server returned an error: (500) ...


4

I think I had the same problem and here is the solution I found. (and I think it is what Robert means, actually) var hostweburl; var appweburl; var clientContext; var appContextSite; var web; $(document).ready(function () { hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl")); appweburl = decodeURIComponent(...


4

At the list view is possible. Edit the list view (click in modify this exhibition), it will have the filters below, place "created by" equals "[Me]". SharePoint puts own how-to tips. check this articles: Example 1 Example 2


4

You don't need to get the object of the newly created item again as ghNewItem since it is already loaded as ghItem . You need another executeQueryAsync call at the end function saveDraftGHrecord() { ghList = web.get_lists().getByTitle('Listname'); var itemCreateInfo = new SP.ListItemCreationInformation(); ghItem = ghList.addItem(itemCreateInfo); ghItem....


4

Client Object Model doesn't have the property to retrieve the ListItem Version details. Instead SharePoint web service provide the option to retrieve the version details of a list item. We can use the below options to get the version details. SharePoint WebService to get Version Collection SPservices to retrieve version history of items from SharePoint ...


4

Try this code to create the picture Library using Javscript: function CreatePictureLibrary() { var context = SP.ClientContext.get_current(); // *********** Host Web Change var hostUrl = GetUrlKeyValue("SPHostUrl"); var hostContext = new SP.AppContextSite(context, hostUrl); var web = hostContext.get_web(); // *********** Host Web Change var ...


4

Try declaring collListItem variable as global variable. OR use it in execCrossDomainRequest() function in the following way this.collListItem = mylist.getItems(camlQuery);


4

According to my understanding you can add jslink like <Form Type="NewForm" Name="{878B105CA-A7O8-7C28-HD7F-5B0DCBA7DSA}" SetupPath="pages\form.aspx" WebPartZoneID="Main" Url="NewForm.aspx" Default="TRUE" FormID="0" JSLink="~site/Scripts/myJS.js "> You can also add more than one JSLink ...


4

In your App url there are various Query String Parameters as shown here. That already containts the site collection url. The Query String paramter "SPHostUrl" will give you the site collection URl. In order to get that URL you can use following code function getQueryStringParameter(paramToRetrieve) { var params =document.URL.split("?")[1].split("&"); ...


4

Check out the global variable SPClientPeoplePicker.SPClientPeoplePickerDict. It's an object which is containing the clientside peoplepicker of the current page. You should be able to identify your peoplepicker by searching for the element with the key peoplepickerdivID + _TopSpan for example ctl00_PlaceHolderMain_peoplePicker_TopSpan. Resolve user for(var ...


4

A1: For the most part the process of developing apps for SharePoint 2013, 2016 and SharePoint Online is the same. The one big difference in the authentication model used by Provider-hosted apps. If you have an on-premises farm you need to use a model called Server-to-Server (a.k.a STS or high-trust) authentication. If you have a hybrid deployment (i.e. both ...


4

Please below post you might get the answer from those Check this http://ikarstein.wordpress.com/2010/12/29/walkthrough-create-custom-sharepoint-2010-list-form-for-deployment-in-a-visual-studio-2010-project/ Check this http://ranaictiu-technicalblog.blogspot.in/2011/06/sharepoint-custom-addeditdisplay-form.html check this too for SharePoint hosted APP http://...


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