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

Check out file JavaScript

$
0
0

Hi,

I want to check out file using JavaScript or Jquery, any code sample please ?

Thanks in advance


SharePoint App deployment using powershell error

$
0
0

I have SharePoint 2013 on premise set up on windows azure cloud, We have set up app catalogue. Developed and deployed sharepoint hosted app from visual studio it works perfectly.

But when i take the same .app file from the solution and try to deploy that file from powershell ( which ultimately we need for the app to be deployed on the UAT server)  it gives me an error.

Powershell command i am using and site collection structure

Web application /Site collection /Subsite  i want to deploy to sub site 

Root site collection : rst

subsite : weather

subsite below weather : meter

$path ="C:\absolute_path_to_app\bin\Debug\app.publish\1.0.0.0\CustomApp.app"
$web = "http://server/weather/meters/"

$web = Get-SPSite $web 

#$spapp = Import-SPAppPackage -Path $path -Site "http://server/" –Source ObjectModel

#$instance = Install-SPApp -Web  $web -Identity $spapp

$instance = Get-SPAppInstance -web $web | Where-Object { $_.Title -eq "customapp" }

when i try to see the app it shows as deployed in subsite and from power shell it gives the instance status all OK

When i go to the sub-site and click on the app it can not redirect to the app and gives page not found error.

Please help 

Thanks in Advance


BCS UserProfile Sync to Oracle not working after upgrade from Oracle 10 to Oracle 11

$
0
0

Hi,

 

I am experiencing problems with a BDC connection to Oracle. The database I am connecting to is moved to a new Oracle 11 server. It was Oracle 10 I use this connection to sync with my user profile service.

 

I have the following Oracle connection in my tnsnames.ora

 

BFTPRD=

  (DESCRIPTION=

    (ADDRESS=

      (PROTOCOL=TCP)

      (HOST=mis-prd-001.intra.nl)

      (PORT=1521)

    )

    (CONNECT_DATA=

      (SERVER=dedicated)

      (SERVICE_NAME=BFTPRD1)

    )

  )

 

My BDC import file:

<?xml version="1.0" encoding="utf-8" standalone="yes"?><Model xmlns="http://schemas.microsoft.com/windows/2007/BusinessDataCatalog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.microsoft.com/windows/2007/BusinessDataCatalog BDCMetadata.xsd" Name="Beaufort"><LobSystems><LobSystem Type="Database" Name="Beaufort" DefaultDisplayName="Beaufort"><Properties><Property Name="WildcardCharacter" Type="System.String">%</Property></Properties><LobSystemInstances><LobSystemInstance Name="Beaufort connection"><Properties><Property Name="AuthenticationMode" Type="System.String">RdbCredentials</Property><Property Name="DatabaseAccessProvider" Type="System.String">Oracle</Property><Property Name="RdbConnection Data Source" Type="System.String">BFTPRD</Property><Property Name="SsoApplicationId" Type="System.String">BeaufortSSO</Property><Property Name="SsoProviderImplementation" Type="System.String">Microsoft.Office.SecureStoreService.Server.SecureStoreProvider,Microsoft.Office.SecureStoreService, Version=15.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c</Property><Property Name="ShowInSearchUI" Type="System.String">False</Property></Properties></LobSystemInstance></LobSystemInstances><Entities><!-- Locatie --><Entity Namespace="http://localhost" Version="1.0.0.0" EstimatedInstanceCount="10000" Name="Beaufort_Locatie" DefaultDisplayName="Beaufort - Locatie"><Properties><Property Name="Title" Type="System.String">Beaufort - Locatie</Property></Properties><Identifiers><Identifier TypeName="System.String" Name="EmployeeNumber" /></Identifiers><Methods><Method IsStatic="false" Name="Beaufort_Locatie_ReadItem"><Properties><Property Name="RdbCommandText" Type="System.String">
									SELECT loc_plaats
									FROM mw_gegevens
									WHERE pers_nr = :EmployeeNumber</Property><Property Name="RdbCommandType" Type="System.Data.CommandType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">Text</Property></Properties><Parameters><Parameter Direction="In" Name=":EmployeeNumber"><TypeDescriptor TypeName="System.String" IdentifierName="EmployeeNumber" Name="EmployeeNumber" /></Parameter><Parameter Direction="Return" Name="Beaufort_Locatie_ReadItem"><TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="Beaufort_Locatie_ReadItem"><TypeDescriptors><TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="Beaufort_Locatie_ReadItemElement"><TypeDescriptors><TypeDescriptor TypeName="System.String" Name="loc_plaats" /></TypeDescriptors></TypeDescriptor></TypeDescriptors></TypeDescriptor></Parameter></Parameters><MethodInstances><MethodInstance Type="SpecificFinder" ReturnParameterName="Beaufort_Locatie_ReadItem" ReturnTypeDescriptorPath="Beaufort_Locatie_ReadItem[0]"
									Default="true" Name="Beaufort_Locatie_ReadItem"
									DefaultDisplayName="Read Beaufort - Locatie external content type"></MethodInstance></MethodInstances></Method></Methods></Entity></Entities></LobSystem></LobSystems></Model>

I configured a Secure Store username and password. This worked before in Oracle 10

When I import this file I get no errors. I configured the sync to use a profile property as the paramater value for "EmployeeNumber". When I run the profile sync I get errors in the ULS:

the host name 'BFTPRD' is invalid and it's could not be found. The exception is System.Net.Sockets.SocketException (0x80004005):
No such host is known     at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)     at Microsoft.SharePoint.Utilities.CommonUtility.IsIntranetAddress(String hostName)	"
Exception occured while logging Sqm data. Exception message: No such host is known	"

IsSystemTypeEnabled[Database] : True	"
Chose Oracle database access provider	"
Initialized DbSystemUtility for LobSystemInstance with Id '775'	"
Db AuthN Mode: 'RdbCredentials' Db Provider: 'Oracle'	"
Checking for current connection to SystemInstance: Beaufort connection	"
st: RemoteAddress: 'https://sha-wp-001:32844/9a37f3b1aeb649c4becc4f1adda70028/SecureStoreService.svc/https' Channel: 'Microsoft.Office.SecureStoreService.Server.ISecureStoreServiceApplication' Action: 'http://schemas.microsoft.com/sharepoint/2009/06/securestoreservice/ISecureStoreServiceApplication/GetRestrictedCredentials' MessageId: 'urn:uuid:fc191350-7f5c-4edf-8408-cc7d6ba31124'	"
Setting credentials obtained from SSO in Connection string	"
Reverting Windows Impersonation:	"
Opened connection to Db:	"
Restoring Windows Impersonation:	"
Executing MethodInstance 'Beaufort_Afdeling_ReadItem' representing command type 'Text'	"
SELECT afdeling          FROM mw_gegevens          WHERE pers_nr = :EmployeeNumber	"
Parameter Signature : System.String :EmployeeNumber,	"
Parameter Values	""
Parameter ':EmployeeNumber':	"
An instance of type 'System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.	"
 monitored scope (BandwidthUsageMonitor). Parent systemUtility.ExecuteStatic: Beaufort connection : Beaufort_Afdeling_ReadItem	"
Monitored Scope (BandwidthUsageMonitor). Execution Time=1.43616	"
um	Finished executing query	"
 monitored scope (BandwidthUsageMonitor). Parent No	"
Monitored Scope (BandwidthUsageMonitor). Execution Time=0.122336	"
um	Closed connection to Db:	"
Error calling importProperties : System.InvalidOperationException: The given dot notation 'AFDELING' refers to a node in Type Descriptor structure that does
not exist.     at Microsoft.SharePoint.BusinessData.Runtime.FieldValueHelpers.SplitWithTypeDescriptors(IEnumerable`1 roots, String dotNotation, IDictionary`2 cache,
Boolean throwWhenAbsent)     at Microsoft.SharePoint.BusinessData.Runtime.FieldValueHelpers.GetTypeDescriptorByDotNotation(IView view, String dotNotation, IDictionary`2
cache)     at Microsoft.SharePoint.BusinessData.Runtime.FieldValueDictionary.get_Item(String fieldDotNotation)
at Microsoft.Office.Server.UserProfiles.ProfileImportExportService.importProperties(IEntityInstance profileEntityInstance, ProfileChangeData profileChangeEntry,
String[] propertyList, Boolean fFirstMatch).	"	


Why do I get the unexpected error "the host name 'BFTPRD' is invalid" When I look at the BCS  connection in Central Admin I see that Host is filled  with the name form TNS names. But that is not a real host. The database name is empty. When I try to fill that BCS thinks it is a SQl connection because then I get the following error in  my ULS

Error calling FindSpecific : Microsoft.BusinessData.MetadataModel.InvalidMetadataPropertyException: The provided database connection string is malformed: Initial Catalog=BFTPRD1;Pooling=False;Persist Security Info=false;User ID=sharepointuser;Password=******** ---> System.ArgumentException: Keyword not supported: 'initial catalog'.
at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)


I also tried setting the secure store username with passing the Oracle schema in the username like sharepointuser@bftprd

then I get this error in ULS

Error calling FindSpecific : Cannot connect to the LobSystem (External System). Reason: 'ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA ' (ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA ) Stack Trace:
at Microsoft.SharePoint.BusinessData.SystemSpecific.Db.DbConnectionManager.Execute(Object[] args)

The first approach should work but I have no idea what is going wromg here. Could it just be the Oracle 11 server that is blocking this?

Unbale to connect database in WCF service sharepoint 2013

$
0
0

Hi ,

                                           

namespace Barkes.Services.Presidents
{
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class PresidentsService : IPresidentsService
    {
        #region Private Members

        private List<President> _presidents;


        #endregion

        #region IPresidentsService Implementation

        public List<President> GetAllPresidents()
        {
            List<President> president = new List<President>();

            string connStr = @"Data Source=WIN-941LO3JBRJG\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True;";

            using (SqlConnection con = new SqlConnection(connStr))
            {

                     con.Open();
                DataTable dt = new DataTable();

                SqlCommand cmd = new SqlCommand("select * from tblEmployee", con);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        President pres = new President();
                        pres.Id = Convert.ToInt32(dt.Rows[i]["ID"].ToString());
                        pres.Name = dt.Rows[i]["Name"].ToString();
                        pres.Gender = dt.Rows[i]["Gender"].ToString();
                        pres.Salary = Convert.ToInt32(dt.Rows[i]["Country"].ToString());
                        president.Add(pres);
                    }
                }
            }
            return president;         

        }
    #endregion

    }
}

Above is the code I am writing to connect to database in sharepoint using WCF referincing below link.

It gives error at  

Cannot open database "Northwind" requested by the login. The login failed.

Login failed for user 'NT AUTHORITY\IUSR' at

  con.Open();  while it works fine if used in sepearate wcf application.

Could any link be provided for the requirement to perform CRUD on sql database table and show the value in sharepoint 2013 in table.

i have been struggling it for long

 


Import from Visio 2016/2013 Greyed out in Designer

$
0
0

Good afternoon, all!

I've run into a problem with importing from Visio into Designer.  When I open the workflows and click "Import from Visio..." the option for Visio 2013 is greyed out.  Web searching has only come up with the idea that Workflow Manager is not installed on the SharePoint server.

However, when I try to add a new workflow, I do get the 2013 option.  Furthermore, I had major troubles installing Workflow Manager and ended up calling Microsoft to assist with the installation.  So, Workflow Manager is installed on the server.

Any other thoughts on why the option is greyed out?

Thanks to all for looking!

Gregg

Managed navigation setting using CSOM

$
0
0

I am trying to Set the "Manage navigation setting" on list using CSOM, but I unable to get the Client side object for MetadataNavigationSettings. this is only available in (Microsoft.SharePoint.Client.DocumentManagement) API.

however this is possible through PS: link here http://get-spscripts.com/2011/03/configuring-metadata-navigation.html

Please refer image2, ( marked in yellow), the values are coming as part of manage navigation setting for particular list. 

and I would like to do this using CSOM.

Image 1:

List Configuration for metadata navigation settings

image 2

Metadata navigation settings


Labhesh Shrimali

How to read the "Name" field from document library in workflow?

$
0
0

Hi,

The task I'm trying to accomplish looks pertty simple: I need to read a value of the item's "Name" field inside the workflow. I try to do it using LookupSPListItem and GetDynamicValueProperties activities. I can get value of the "Title" field, also I created custom field and can read it too.

But the "Name" field always comes empty.

I guess I need to use some tricky syntax or this field has some different "internal name"?

The workflow is designed in VS 2013.

Is there any utility that can give you the speed of specific functions in a SharePoint c# Soution?

$
0
0

Hi,

I have taken over someone's code which is a C# Farm Solution for SharePoint 2013 On-Premises.  Users have been experiencing serious degradation on page loads (which contain three web parts). As the list becomes bigger so the system gets slower. I am pretty sure this is related to queries on the list. However, there are a hell of a lot of queries on this system and I just wanted to know is there a utility in-built in VS or third-party which provides you with functions and their speeds so I can nail it down.

I have looked at Developer Dashboard that there are a few large SQL Queries, but not sure in what functions they reside.

Can anyone help?

Thanks.

John.    


External List form template

$
0
0
I have created a external list and now I would like to have only one form template for new, edit, and display. Is it possible? If yes, what's the best way to achieve it?

How to save a list as template with contents in CSOM ?

$
0
0
How to save a list as template with contents in CSOM ? SaveSiteAsTemplate option is missing in CSOM.

Harishkumar VJ Senior Sharepoint Developer

Web App Level Feature not showing in SharePoint 2013

$
0
0
I have a SharePoint 2013 site configured for FBA and Multi Tenancy. In our case, we have a Multi Server Farm, which has a Web Front End, App Server, Search Server, Workflow Server and DB servers. We have custom code to deploy features. We have a web app level feature, which actually creates Custom Diagnostic Areas and Categories. This works fine in our local development environment which is a standalone, but in the multi server farm environment, this feature is not even shown in the Web App Level features. We are not sure, what is going here. Can anyone please suggest, what could be going wrong here.

Ven

Problem with ExecuteOrDelayUntilScriptLoaded with ScriptForWebTaggingUI.js when initializing Managed Metadata Fields in UI

$
0
0

Currently I'm porting an existing SharePoint 2010 solution to SharePoint 2013. Currently I'm struggling with a small javascript issue. The javascript is a small routine which disables some managed metadata fields to prevent users to change those fields within a custom page opened in a dialog. Currently we run a method at page load which initializes this by using the method ExcuteOrDelayUntilScriptLoaded(InitFieldsMethod, "ScriptForWebTaggingUI.js"); In SP2010 this part of code was working. What it actually does is that it executes our initialization method after the rendering and initialization of the metadata controls was done (this was done in SP2010 by ScriptForWebTaggingUI.js). In SP2013 it seems that this method doesn't work anymore.

When I use this code the initialization method gets called to early, because the rendering of the metadata fields hasn't done yet. What I've tried is to place the ExcuteOrDelay routine later in the page or bind it to other js files like sp.js. But all of these variants didn't work properly. Does somebody know what I can do to force that the initialization code runs after the metadata fields have rendered properly? The code itself still works, which I've verified by using the developer toolbar in IE 8 and then call the initialization from console manually after proper loading of the page.

SharePoint Designer 2013 and WYSIWYG

$
0
0

I have got SharePoint Desinger 2013 which I got for free from microsoft.com. Somehow I can not manage to enter WYSIWYG mode. Could it be that WYSIWYG is not included in the free version? The version number is 15.0.4420.1017.

Unable to activate a Workflow Feature invoking an external Web API from SharePoint 2013 Visual Studio Workflow

$
0
0

I have an On-Premise SharePoint 2013 Development environment with Visual Studio 2013 Workflow. It is a stand alone server. It also hosts a separate IIS site, which has a Web API. When I am trying to call this Web API from my SP2013 Visual Studio Workflow and I am trying to deploy it, it is giving me an error as below, even though I am setting the the Authorization on the RequestHeader. Can anyone please help?

Error occurred in deployment step 'Activate Features': Microsoft.Workflow.Client.WorkflowManagementException: Exception thrown from the messaging layer. For more details, please see the server logs. HTTP headers received from the server - ActivityId: e2057b92-61c8-4c01-9e05-e89247d05457. NodeId: {MachineName}. Scope: /SharePoint/default/22bc9b5c-7d8d-40c7-a3c7-8cd4051b7502/10f92945-9b88-484b-9a60-ea43838bce61. Client ActivityId : 19a58d40-3f93-4423-bccf-4fe215af8e58. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.


Ven

Sharepoint Office 365 OAuth Service authentication to list.asmx

$
0
0

I´m trying to access Sharepoint list data in Office 365 from an external website. I registered my app in Azure Active Directory and I've done all the process of creating and trusting a certifacte and getting the access token.

Add-Type -Path ".\Microsoft.IdentityModel.Clients.ActiveDirectory.dll"

$authenticationContext = New-Object Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext -ArgumentList "https://login.microsoftonline.com/{myTenantId}/", $false

$cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cer.Import(".\WithPrivateKey.pfx", "privateKey", [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::MachineKeySet)

$clientAssertion = New-Object Microsoft.IdentityModel.Clients.ActiveDirectory.ClientAssertionCertificate -ArgumentList "{myClientId}", $cer

$authenticationResult = $authenticationContext.AcquireToken("https://{tenantName}.sharepoint.com", $clientAssertion)

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Bearer " + $authenticationResult.AccessToken)

I can successfully call to Sharepoint REST Api by presenting the access token in request headers.

$response = Invoke-RestMethod -Uri https://{myTenantName}.sharepoint.com/sites/devSite/_vti_bin/ListData.svc/TestList -Method Get -Headers $headers 

However I can't do the same to access asmx endpoints, such as Lists.asmx, whenever I try to call any method on those services I get 401 UNAUTHORIZED

$body = '<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>TestList</listName></GetList></soap12:Body></soap12:Envelope>'

$response = Invoke-WebRequest -Uri https://{myTenantName}.sharepoint.com/sites/site/_vti_bin/Lists.asmx -Method Post -ContentType 'application/soap+xml' -Headers $headers -Body $body

How to Publish outlook room list resource calendar to SharePoint?

$
0
0
Hi All,

In exchange its already configured two room booking services as Room1 and  Room2. So in my outlook I open calendar of Room1 and Room2. Now, How can I sync/upload these two calendar to SharePoint? thanks.

Programmatically Get Version Changes for List Item in SharePoint 2013

$
0
0
Is it possible to get only the changes (changed field values) from every version of a List Item in SP 2013? If so, can anyone please explain it in detail with code?

Ven

Get External list data

$
0
0

Hi,

The scenario is that I have an Employee table in sql database containing more than 5000 items.

Now I want to show the items in webpart based on some column say user country = india and city = mumbai. 

When I connect the table using BCS sharepoint designer and get value in list than I get the whole 5k items if i set limit then some of my items are not populated in sharepoint list.

How can I achieve the above requirement using BCS. Any out of the box solution or custom code.

We use javascript client object model mostly in our webpart

Regards

Md Zakir

Site Policy Creation for making Office 365 sites read only

$
0
0

Hi

Is it feasibile to make sites read-only using CSOM, using Site Policy in Office 365 ?

if yes, can you pls. provide the details of the scripts to create the policy and apply on the site?

Thanks

Vijay

Workflow for Calendar events

$
0
0

Hi,

I have a calendar with multiple events per day. I want to create a SPD workflow which sends daily email to recipients with details of the events in email. All the events for 1 day should be combined in 1 email . Please provide some guidance on how we can create this workflow.


Amrita Talreja

Viewing all 7589 articles
Browse latest View live


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