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

How works SP.DateTimeUtil.SPRelativeDateTime.getRelativeDateTimeString (documentation, links, examples )?

$
0
0

Hello,

i try to use in my custom webpart a function SP.DateTimeUtil.SPRelativeDateTime.getRelativeDateTimeString from fileSP.DateTimeUtil (SharePoint 2013):

SP.DateTimeUtil.SPRelativeDateTime.getRelativeDateTimeString(myDate, false, SP.DateTimeUtil.SPCalendarType.none, false)

It works and returns back a result like "2 days ago". But there is a problem. It returns back some texts on English and some on Russian.  I'm added webpart on website, which has been create based on Russian template. 

I tried also to add this webpart on list view page (AllItems.aspx) and found, that now all text returns on Russian. Not clear why, but it is already better, but still there are a grammatical errors, which are missing in the list view for the same entries.

Unfortunately I didn't find a documentation or normal examples. Everything that I have - it is a file SP.DateTimeUtil.js ((.

Please help me to understand how  this function works (examples or links)! Thanks a lot!


from MSDN forum...




AppFabric 1.1 for SharePoint 2013 uninstall and Re-install

$
0
0

Dear All,

I am trying to set up SharePoint Server 2013. I am installing SharePoint 2013 on Windows server 2012 Standard with SQL Server 2012.

Like all newbies to SharePoint 2013, I installed all the pre-requisites manually but on initiation of SharePoint 2013 set-up, it said that AppFabric was not configured for SharePoint 2013. I installed and tried reinstalling using the following procedure;

1. Changing the Environment Variable

2. Installing through powershell using the prerequisiteinstaller.exe

3. Saving the temporary installation folder and editing the registry

4. I cannot find the AS_Administrator and AS_Observer groups.

5. I get the error code 1603

all solutions above are not working

I am defeated developers and I badly need your help. If anyone has been successful with this problem please HELP

Sharepoint Online (O365). Cannot get current navigation items if site has more than 5-6 sibsites

$
0
0

API call https://<mydomain>.sharepoint.com/sites/Test/_api/navigation/menustate?mapprovidername='CurrentNavigationSwitchableProvider'

Gives error:

<?xml version="1.0" encoding="UTF-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code>-1, Microsoft.SharePoint.Navigation.REST.NavigationServiceException</m:code><m:message xml:lang="en-US">An unexpected error occurred: </m:message></m:error>

Error disappears only when Navigation setting "Maximum number of dynamic items to show within this level of navigation" for site 'https://<mydomain>.sharepoint.com/sites/Test/' is set to values between 1 and 6, or when "extra" sites are deleted.

Problem occurs for sites with subsites count greater than 6. Error occured on 2 site collections in "production", and reproduced in test site collection created from scratch. Site collections were created from Publishing portal English template.

Hiding the Quick Launch for one page or...

$
0
0

Hello,

How can I hide the quick launch menu for one page or get the fullscreenmode on loading (for one page) ?

Best regards,

EM.



Filter sharepoint Document Library based on DocumentID

$
0
0

Hi,

We have some documentID which are starting with the different series.how to write the query or create the view to get the re cords which are having thosed documentID.

Need help on this.

Thanks in advance,

KK



How to check if the given user name is valid or not using CSOM

$
0
0

Hi All,

Is there a way we can check if the user name that I have is valid SharePoint user or not. I am writing code using CSOM to bulk insert data in SharePoint list from excel and some of the users so not exists. If the user does not exists the create item creation fails. 

Thanks in Advance.

Regards,


Monali

How to find out user who does not exists

$
0
0

Hi All,

I am working on migrating a Moss 2007 list to SharePoint 2013(On Prem) list. The list has people picker fields. Many of the users in this column values do not exists in the system. Is there a way we can find out which users do not exists anymore ?

Please not I do not have access to server so please suggest any client side script or api that is available to validate users that do not exits.

Thanks,

Monali


Sharepoint workflow issue

$
0
0

Dear,

I have created a custom content type with workflow task(SharePoint 2013) and custom task outcome. Also I have linked this new content type into the workflow which designed by SharePoint designer 2013. But when I run this workflow it will pending start status, no email send, no task assigned and so on. Anybody who know how to fix it?


Create SharePoint 2013 List View using JavaScript or REST API

$
0
0

Hi,

Am trying to create a new View in SharePoint 2013 List using client side scripting at run-time using some filter values. Has anyone tried that ? 

Thanks,

Nutan


Open a document in a new tab or browser window Sharepoint 2013

$
0
0
Customer requirement states that a doc must be opened in the browser, but requires that it open in a new window or tab.  I know that this is bad practice, but customer is the customer.  Please provide the best course of action.  95% of docs will be PDFs and can not use client application as the means of opening.  Appreciate your help and easiest, simplest solution.

getTagFromIdentifierAndTitle in SharePoint 2013 returns null

$
0
0

I have some javascript that runs when the new item form is opened. The code works fine in SharePoint 2010, but will not work in SharePoint 2013. When the form loads, I get an Unable to set property 'value' of undefined or null reference error so the getTageFromIdentifierandTitle function is returning null, but I can't figure out why. 

I am using the below code.

_spBodyOnLoadFunctionNames.push("executeOnLoad");

function executeOnLoad()
{
  getTagFromIdentifierAndTitle("input","","RequestID").value = id;
  getTagFromIdentifierAndTitle("input","","Date Created").value = simpleDate;
}

function getTagFromIdentifierAndTitle(tagName, identifier, title)
{
  var len = identifier.length;
  var tags = document.getElementsByTagName(tagName);
  for (var i=0; i < tags.length; i++) {
    var tempString = tags[i].id;
    if (tags[i].title == title && (identifier === "" || tempString.indexOf(identifier) == tempString.length - len)) {
      return tags[i];
    }
  }
  return null;
}

Event receive deployment to additional library

$
0
0

HI,

I inherited an event receiver that has been deployed to "year-2014", "year-2015" info path form library, now I am trying to deploy it to 2016 library(this is just forms that are supposed to be submitted in three different form libraries for different years.). Changing list url attribute in existing Elements.xml and redeploying this event receiver has absolutely no effect, it just stays with 2014, 2015 libraries even when I completely removed references to these libraries it in elements.xml. The whole solution file contains no references (apart form the elements.xml) to two libraries that it had been deployed to.  In my opinion there has to be a second configuration file/method by which the deployment is made. 

Again, i need to add the event receiver to additional form library and I am not able to do so by changing elements.xml references.

Any help would be much appreciated...

Regards and thanks,


Nemnaja Sovic

Is it possible to inject code to pages by feature?

$
0
0

Hi,

I'm wondering if it is possible to create a farm Feature that when activated it will inject a script reference element into the HEAD section on all pages, and remove the script reference when the feature is deactivated?

Thank you for any pointers.

SharePoint Online: People Manager

$
0
0

What's the difference between People Manager with fewer methods and People Manager with more methods?

I am using Microsoft.SharePoint.Client.UserProfiles.dll. I created

PeopleManager peopleManager =newPeopleManager(ctx);

but it doesn't have SetSingleValueProfileProperty method and many others. What did I do wrong? How can I use this People Manager with more methods?

Just to add more info I tried the same thing with Powershell and again the peoplemanager object did not have the required method:


Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" 
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" 
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.UserProfiles.dll" 

$peopleManager = new-Object Microsoft.SharePoint.Client.UserProfiles.PeopleManager($ctx);

$peopleManager.SetSingleValueProfileProperty()
                    $ctx.ExecuteQuery()


How do I bulk upload documents into SharePoint along with metadata, using Powershell?

$
0
0

I have a ton of documents that I have to upload into SharePoint from a file share using PowerShell, along with metadata that is in a csv (or excel) file. Is it possible to have a general code that can read/match the columns listed on the .csv file with the columns in the SharePoint library? I was wondering if it is possible to create a script that can be used on any library, without having to list the column names within the code. Am trying to come up with a script that can just be used on any library. Am currently doing something like this, but I would like to use something more generic...where I don't have to specify the column names. Is this even possible?

$SiteUrl = "URL OF THE SITE COLLECTION"
$web = Get-SPWeb $SiteUrl
$csvFile = "C:\\CSVFILEWITHMETADATA.csv"

foreach($i in Import-CSV $csvFile)
{
	$Library = $i.DocumentLibrary
	$docLibrary = $web.Lists[$Library]
	$rootFolder = $docLibrary.RootFolder
	$sourceFile = Get-ChildItem $i.DocumentLink
	$destinationFolderPath = $rootFolder.Url

	if($i.DestinationFolder -ne "")
	{
		$destinationFolderPath += "/" + $i.DestinationFolder.replace("\","/")
		$folders = $i.DestinationFolder.Split("\")
		$subFolder = $rootFolder
		foreach($f in $folders)
		{
			$testFolder = $subFolder.SubFolders[$f];
			if($testFolder -eq $null)
			{
				$subFolder = $subFolder.SubFolders.Add($f)"created new folder " + $f
			}
			else
			{
				$subFolder = $testFolder
			}
		}
	}
	$destinationFolderPath += "/" + $sourceFile.Name"copying " + $destinationFolderPath

		$itemType = $docLibrary.ContentTypes[$i.ContentType]
		$newFile = $docLibrary.RootFolder.Files.Add($destinationFolderPath,$sourceFile.OpenRead(), $true)
		$theItem = $newFile.Item
		$theItem["ContentTypeId"] = $itemType.Id
		#Write success to log file
		$logMsg = "File name " + $i.FileName + " with content type " + $i.ContentType  + " successfully added" + "|Success"
		Add-Content $logFile $logMsg

		# UPDATING METADATA
		$theItem["Description"] = $i.Description
		$theItem["Title"] = $i.Title
		$theItem["Seller"] = $i.Seller
		$theItem["Buyer"] = $i.Buyer
		$theItem["PurchaseDate"] = $i.PDate
		$theItem["ExpDate"] = $i.ExpirationDate

		# Prepare and Populated Taxonomy field for Status
		$myStatus = $i.Status
		$termST = $terms | ?{$_.Name -eq $myStatus}
		$tFieldStatus = $docLibrary.Fields["Status"]
		$tItemFieldStatus = [Microsoft.SharePoint.Taxonomy.TaxonomyField]$theItem.Fields[$tFieldStatus]
		$tItemFieldStatus.SetFieldValue($theItem, $termST)

		# Prepare and Populated Taxonomy field for Sales Type
		$mySalesType = $i.SalesType
		$termSalesType = $terms | ?{$_.Name -eq $mySalesType}
		$tFieldSalesType = $docLibrary.Fields["SalesType"]
		$tItemFieldSalesType = [Microsoft.SharePoint.Taxonomy.TaxonomyField]$theItem.Fields[$tFieldSalesType]
		$tItemFieldSalesType.SetFieldValue($theItem, $termSalesType)

		$theItem.Update()
}
$web.Dispose()


Double Check Field

$
0
0

Hello community,

I have a question. Is it possible to have two fields on a form that must match? We have reference numbers for incentive cards in the field and we often have problems because of fat fingering or mis-keying. I would like to create an additional reference number field (maybe reference number confirmation?), in the request form where it flags the user that it does not match the first.

Is this possible using InfoPath? I cannot make it an index as that is already used.

I am very unfamiliar with code, so if there is something else?

Thank you for any and all help.

Getting value of @Category field in xslt

$
0
0

Hi,

Any Ideas how to get value of @Category field (lookup/dropdown field) and check it's value?

Idea is to style ".date" based on value in field.

Below what if have tried :

<xsl:variable name="class" select="@Category" />
<xsl:choose>
    <xsl:when test="contains($class,'fault')">
            <span class="date" style="background:red;">
            <xsl:value-of select="ddwrt:FormatDateTime(@StartTime,1033,'M.d.yyyy')" />
            </span>
    </xsl:when>

    <xsl:when test="contains($class,'break')">
            <span class="date" style="background:yellow;">
            <xsl:value-of select="ddwrt:FormatDateTime(@StartTime,1033,'M.d.yyyy')" />
            </span>
    </xsl:when>

    <xsl:otherwise>
        <span class="date" style="background:green;">
            <xsl:value-of select="ddwrt:FormatDateTime(@StartTime,1033,'M.d.yyyy')" />
            </span>
    </xsl:otherwise>
</xsl:choose>



Antti Astikainen

Why does own feature not appear in PowerShell?

$
0
0

Hello,
I deployed my own SharePoint hosted app and the app appears in the host sitecollection as a "feature". However, I cannot find the feature when I use "Get-SPFeature -Limit ALL" as a PowerShell command. 
The list does not contain the GUID of my own feature. Can anybody explain this behaviour?

Thanks,
David

Issue with Workflow 2013 as a SharePoint App Application

$
0
0

Hi,

I am using standalone installation of SharePoint 2013 with Workflow manager enabled (Workflow 2013).

I have created a Workflow 2013 application (app for SharePoint - a list workflow) using Visual Studio 2012.

In visual studio, I have following projects / Folders -

1. Features

2. Package

3. Content

4. Custom Lists

5. Images

6. Pages

7. Scripts

8. App Manifest file & a packages config file 

When I deploy this app using Visual Studio, I can see app being successfully deployed to site.

Some of the important excerpts copied from Visual Studio output window -

.............

.............

Successfully created package at: C:\Users\so-saxenav\Documents\Visual Studio 2012\Projects\SPAppForWF2013\SPAppForWorkflow2013\SPAppForWorkflow2013\bin\Debug\app.publish\1.0.0.0\SPAppForWorkflow2013.app

.............

.............

App was installed athttp://saxenav-ba6da513bc4182.app.lab.local/SPAppForWorkflow2013/

Host resolution for saxenav-ba6da513bc4182.app.lab.local failed with the following exception: System.Net.Sockets.SocketException (0x80004005): The requested name is valid, but no data of the requested type was found

at System.Net.Dns.GetAddrInfo(String name)

at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)

at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)

at Microsoft.VisualStudio.SharePoint.FileBasedHostNameResolver.AddHost(String appWebDomainName, String parentWebUrl, Guid productId).

Added 'saxenav-ba6da513bc4182.app.lab.local' to HOSTS file.

Successfully installed app for SharePoint.

Skipping deployment step because a post-deployment command is not specified.

========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

.............

.............

At the end of deployment, it opens up the Sharepoint site showing my app and I am asked to trust this app on the site .

Once trusted, it is redirected to app home page. Notice that app is being published to its own app domain (app.lab.local) on Sharepoint site which is hosted on main lab.local domain.

However when I click on workflow links, it says that this site has no workflows on this site.

If I go to the custom list that was published to site as part of my app, it says that there are no workflow to associate.

However, I did have target list associated with workflow in workflow project property. My workflow just have a simple REST API call activity and writing a message to workflow history.

So question I have is - why do I not see any workflow anywhere in the app I published on Sharepoint site even when workflow XAML file/project was part of the solution I deployed through visual studio?

I noticed that feature maifest file I have in Visual Studio dont have any reference to workflow XAML file but from what i searched on MSDN, it seems to be an expected behavior so I am kind of confused as to how and where workflow in app is being deployed.

Provision property bag for document library declaratively via sandbox

$
0
0

I have a no-code sandbox solution that I use to provision artefacts. One is a document library to which I want to attach a property bag to be set by a user via custom setting page.

I learned that one can not directly attach a property bag to a document library but only to its root folder. I know how to add property bags to items but did not succeed in adding those to a root folder.

Any help appreciated.

Viewing all 7589 articles
Browse latest View live


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