European Sharepoint 2013 Hosting Blog
Articles about European Sharepoint Hosting Service
Articles about European Sharepoint Hosting Service
May 24th
Lately, I have come across some need where I need to determine the version of the SharePoint site that is being used. The business users are not sure what version of SharePoint they are using. Did little research and came across the following methods. Let’s get into those details.
This is the simplest way to determine the version of SharePoint being used. By getting the host header URL and then appending ‘/_vti_pvt/service.cnf’ the URL.
If the version says 15.0.0.5399 then it is SharePoint 2013.
The other way is to use developer tools Edge or Chrome, and look into resource files response headers. Let’s see how to do that.
Step 1
Login into your SharePoint site, and do ‘ctrl+shift+I’ I am using Google chrome here.
Step 2
Click on the ‘Network’ tab. If there are no scripts getting loaded, try refreshing the page. You should be seeing the list of the scripts getting loaded under ‘Network’ tab.
Step 3
Select any resource file like init.js, resource.js or sp.init.js. check the ‘Response header’.
Step 4
At first you see General Tab. Scroll down a bit and check for ‘Response Header’ and underneath check for version of SharePoint.
In my case the version no. is 15.0.0.4420, in my case the version is SharePoint 2013.
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.
May 13th
Here, we will discuss how to add a new line in multiline textbox using XML file in InfoPath.
Let’s start to create the XML file with standard coding. Please follow the below steps to achieve this.
You can copy the code directly from here as well.
Now, your file is ready with code. Now, follow the below steps to implement this task.
Upload your file under SharePoint Site Asset Library.
Try to create a data connection with the connection type as retrieve data.
Click on “Next” and choose the XML file option.
Go to SP site asset and try to copy your XML file path and paste here.
And, finish the Data Connection Creation here.
You have to create a simple text box control, go the textbox properties, and enable the multiline textbox.
Now, you can manage the rule and apply the data connection for a new line in a multiline textbox. I hope your issue has been resolved now.
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.
May 12th
In this article, I will walk you through the process of testing SharePoint Online REST APIs using the POSTMAN tool.
Step 1
Go to https://<YourSharePointCollectionURL>/_layouts/15/appregnew.aspx to register a new Sharepoint app. Follow the steps as shown in the screenshot below.
For example – https://contoso.sharepoint.com/sites/ContosoTeamSite/_layouts/15/appregnew.aspx
Step 2
Once the Client Id & Client Secret are generated successfully, you will be redirected to a new page as shown in the screenshot below with your app details. Note down the Client Id and Client Secret values. We will be using them in the next steps.
Step 3
To grant permission to your app go to https://<YourSharePointCollectionURL>/_layouts/15/appinv.aspx
For example- https://contoso.sharepoint.com/sites/ContosoTeamSite/_layouts/15/appinv.aspx
Step 4
We need Tenant Id also. So to get the Tenant Id go to https://<YourSharePointCollectionURL>/_layouts/15/appprincipals.aspx
For example – https://contoso.sharepoint.com/sites/ContosoTeamSite/_layouts/15/appprincipals.aspx
Step 5
After getting the Tenant Id, Open the POSTMAN tool and make a POST request to the below URL with your App & Tenant details to get the access token.
URL: https://accounts.accesscontrol.windows.net/tenant_id/tokens/OAuth/2/
Headers
Content-Type:application/x-www-form-urlencoded
Body
grant_type:client_credentials
client_id:client_id@tenant_id
client_secret:client_secret
resource:00000003-0000-0ff1-ce00-000000000000/YourSharepointOnlineDomainName@tenant_id
Change the values in Red color with your corresponding App & Tenant details. The client_id & client_secret can be obtained from Step2 and tenant_id from Step5.
For example
grant_type:client_credentials
client_id:7a7a12k2-987f-8473-f1n8-gh83658e6a74@3349739d6-3284-9403-kf0b-g631m13d86g7
client_secret:9VNnkLNhdhdhWuuststfMUBNEv1tsjdiDvKG3ry7=
resource:00000003-0000-0ff1-ce00-000000000000/contoso.sharepoint.com@3349739d6-3284-9403-kf0b-g631m13d86g7
Step 6
Now copy the access_token from the response.
Step 7
Make a GET call to get items from SharePoint List
URL: https://<YourSharePointCollectionURL>/_api/web/lists/GetByTitle(‘<ListDisplayName>’)/items
For example
My Site Url is: https://contoso.sharepoint.com/sites/ContosoTeamSite
List DisplayName is: Leaves
REST URL: https://contoso.sharepoint.com/sites/ContosoTeamSite/_api/web/lists/GetByTitle(‘Leaves’)/items
Headers
Authorization:Bearer access_token
Accept:application/json;odata=verbose
Content-Type:application/json;odata=verbose
Note
There should be a space between Bearer and access_token in the Authorization header
So in this article, we learned how to test SharePoint Online REST APIs using the POSTMAN tool. I hope you enjoyed reading this article.
Apr 25th
Microsoft has recently released SPFx 1.15.1 Preview version adding a few new features and updates for building SPFx-based solutions. We can find full release notes at the link. One of the major and important features coming with this version is the ability for users to customize new, edit, and display forms of lists and libraries. This has been la ong asked-for and awaited feature which we now have a way to achieve using SPFx.
Please note that as this is still in preview, it involves some manual steps to test the customizer. Also as of today, applying the customizer to list or content type is still in progress and we are developers would only be able to test and debug this and cannot deploy to actually list.
In this article, we will go step by step on creating a Form customizer and then test it by the local debugging experience of SPFx.
Assuming you have already set up your SPFx environment, below are steps to be followed.
For the sake of simplicity, we will create a list with only two columns,
Title – Single Line of Text
Description – Multiple lines of Text
Next, we will have to enable Content type, Go to list settings -> Advanced Settings -> Select Yes on “Allow management of content types?” and click on Save.
In this step, we will also have to copy the List content type which we will need later. Now on the list settings, we will see Item content type added. Click on Item and then copy the content type id from url.
Copy this ctype value from the query string and keep it handy to be used later.
Next, we will go ahead and create the SPFx project. Go to the command prompt and create a folder of your choice. Run below command
We will be asked a series of questions, choose the below options and continue.
Select component type as Extension and then type of extension as Form Customizer, this is a new option that you will find with this new release.
Once successful, we should see below screen:
Replace this in all the serveConfigurations objects. Refer screenshot below.
Next, we will modify React component which is responsible for showing control when the form customizer is loaded.
Go to src\extensions\firstCustomizer\components\FirstCustomizer.tsx
Modify the render method to below
Go to command prompt again and run
It should open the browser with the below screen,
Click on Load Debug Scripts, if it loads correctly, we will see the below screen.
Now that we know the configuration is correct we will modify the Form code to add input controls and buttons and logic to save data to SP list. For saving data to SP list we will use pnpjs.
Kill the gulp serve and run the below command to install a specific version of pnpjs
Please note we are using an older version of pnpjs for simplicity and reuse my old code 🙂
Once it is installed, let us modify Go to src\extensions\firstCustomizer\components\FirstCustomizer.tsx.
Add a few imports which we need to use.
Replace render method to add controls
Create a State interface to hold values from controls, you can add below where IFirstCustomizerProps is declared.
Add below line below state declaration
Modify FirstFormCustomizer class to use State and then create a constructor
Add below 4 methods to handle the logic to save state, save in sp list, and reset controls
Explanation about code
Run gulp serve again and click on Load debug script on the browser once opened
We should see the below output
Enter some value in Title and Description and click on Create new item
Go to the list and see a new entry is created
This will conclude our First Demo on Form customizer with SPFx, you can refer to the source code at this repo. We’re waiting for the release of the new feature when we will be able to assoicate this with actual Lists. It will be interesting to see how this will work out and the experience when user clicks on New Item, Edit Item, etc…
Apr 21st
1 |
$Email = Read-host "Enter the Email ID of user" |
Step 2
1 2 |
$pattern = '(?<=\@).+?(?=\.)' $OrgName = [regex]::Matches($Email, $pattern).Value |
Step 3
1 2 3 4 5 6 7 8 9 10 |
function Construct - OneDriveString { param( [string] $InputString, [string] $Replacement = "_", [string] $SpecialChars = ".@") $rePattern = ($SpecialChars.ToCharArray() | ForEach - Object { [regex]::Escape($_) }) - join "|" $InputString - replace $rePattern, $Replacement } |
1 |
$OneDriveUrl = "https://$OrgName-my.sharepoint.com/personal/" + $OutputString + "/_layouts/15/onedrive.aspx" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
function Construct - OneDriveString { param( [string] $InputString, [string] $Replacement = "_", [string] $SpecialChars = ".@") $rePattern = ($SpecialChars.ToCharArray() | ForEach - Object { [regex]::Escape($_) }) - join "|" $InputString - replace $rePattern, $Replacement } $Email = Read - host "Enter the Email ID of user" $OutputString = Construct - OneDriveString $Email $pattern = '(?<=\@).+?(?=\.)' $OrgName = [regex]::Matches($Email, $pattern).Value $OneDriveUrl = "https://$OrgName-my.sharepoint.com/personal/" + $OutputString + "/_layouts/15/onedrive.aspx" #Checking the URL try { Write - Host "verifying the url $OneDriveUrl" - ForegroundColor Yellow $CheckConnection = Invoke - WebRequest - Uri $OneDriveUrl if ($CheckConnection.StatusCode - eq 200) { Write - Host "Connection Verified" - ForegroundColor Green } } catch [System.Net.WebException] { $ExceptionMessage = $Error[0].Exception if ($ExceptionMessage - match "403") { Write - Host "URL exists, but you are not authorized" - ForegroundColor Yellow } elseif($ExceptionMessage - match "503") { Write - Host "Server Busy" - ForegroundColor Red } elseif($ExceptionMessage - match "404") { Write - Host "URL doesn't exists" - ForegroundColor Red } else { Write - Host "There is an error" - ForegroundColor Red } } |
Apr 14th
When working with SPFx projects, often time we might think of following questions
When working on .Net projects it is easy to share solutions and packages. The required binaries will be created in debug/bin or release folder, and source code can be zipped and shared with team or source code can be checked in Git repository. But the dependency is the user who is consuming this application should have .Net runtime installed (mostly available on all Windows OS and needs to be installed on other OS such as Linux) and to test and debug the application Visual studio needs to be installed.
Since SPFx (SharePoint Framework) is cross-platform developer environment, the run time will be provided by the NodeJS. Users who are working with the SPFx should have their machines installed with NodeJS application which provides runtime and required files for successful development, testing and packaging the solution. Please refer to the references section for installing node using NVM (node version manager) that has details.
Let’s try to understand the basic SPFx folder structure that gets created. In this article, I have taken the folder structure for Application Customizer. A similar folder structure gets created for other SPFx project types.
Folder | Purpose | Image |
src | The main repository for your application, and starting point, is where you write code and initialize the components. | ![]() |
lib | Contains processed code, that gets created during compilation and transpilation | ![]() |
dist | This folder gets created during gulp serve and contains the javascript bundle and manifest. During the testing the local node server will be distributing the content to your application in SharePoint workbench from this folder. | ![]() |
config | Contains set of configuration files used by projects for various build tasks such as how the solution is packaged, and where the static assets and code is hosted. | ![]() |
node_modules | Contains all the run time packages and dependencies which is created as part of npm install. | ![]() |
release | Folder gets created during serve, bundle and package commands. This contains assets folder that contains files generated when bundle and packaging the solution. | ![]() |
sharepoint | Contains the solution folder that contains sppkg file which is final package that will be deployed to tenant-level or site level app catalog. This also contains assets folder which has details about whether tenant wise install or specific to few sites. | ![]() |
temp | This folder gets created during serve and is used by local node server during testing | ![]() |
For source control, the following folder can be omitted and checked into to source code repository.
Please refer to article, code check-in using git commands that tells the steps to check in the code to source control.
Once the solution is downloaded from source control or unzipped, one can test the solution in other environment by following steps
Step 1
Unzip the file if downloaded as zip. Go to the command prompt and run the following command.
npm install
Step 2
Test the solution by running following command to make sure there are no run time issues before packaging the solution
gulp serve
Allow the debug scripts.
If there are no issues, you should be getting an alert message similar to below one.
Step 3
Build the solution to make sure there are no compile time issues.
gulp build
Step 4
If needs to be bundled to install into different environment, then run below command
gulp bundle –ship
Step 5
To package the solution run the below command
gulp package-solution –ship
Step 6
Observe the folder structure, you could see that the following folders got created again in destination, even if they are omitted from the source.