European Sharepoint 2013 Hosting Blog

Articles about European Sharepoint Hosting Service

Follow me on TwitterRSS Feeds

  • Home
  • About

SharePoint 2013 Hosting – HostForLIFE :: How To Know The Version Of SharePoint

May 24th

Posted by Peter in European SharePoint 2013 Hosting

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.

Method 1: Getting the host header URL

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.

Method 2: Using Developer Tools

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.

Note on SharePoint versions

  • If the version number starts with 15 series then it is SharePoint 2013
  • If the version number starts with 16 series and with the format of 16.0.xxxx (4 digits after 16.0) then it is SharePoint 2016
  • If the version number starts with 16 series and with the format of 16.0.10xxx (5 digits after 16.0 and starts with 10) then it is SharePoint 2019
  • If the version number starts with 16 series and with the format of 16.0.14xxx (5 digits after 16.0 and starts with 14) then it is SharePoint Server Subscription Edition

SharePoint 2013 Hosting Recommendation

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.

hostforlifebanner

Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting

SharePoint 2013 Hosting – HostForLIFE.eu :: InfoPath-Add Newline In Multiline Text Box Using XML file (SharePoint)

May 13th

Posted by Peter in European SharePoint 2013 Hosting

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.

SharePoint 2013 Hosting Recommendation

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.

hostforlifebanner

Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting

SharePoint 2013 Hosting – HostForLIFE :: How To Test SharePoint Online Rest APIs Using Postman Tool

May 12th

Posted by Peter in European SharePoint 2013 Hosting

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

  • Get the Client Id from Step2 and paste it in the App Id field and click on the Lookup button. It will fetch all your App details.
  • Copy & Paste below XML in Permission Request XML section.
1
2
3
<span class="token operator">&lt;</span><span class="token maybe-class-name">AppPermissionRequests</span> <span class="token maybe-class-name">AllowAppOnlyPolicy</span><span class="token operator">=</span><span class="token string">"true"</span><span class="token operator">&gt;</span>
<span class="token operator">&lt;</span><span class="token maybe-class-name">AppPermissionRequest</span> <span class="token maybe-class-name">Scope</span><span class="token operator">=</span><span class="token string">"http://sharepoint/content/sitecollection/web"</span> <span class="token maybe-class-name">Right</span><span class="token operator">=</span><span class="token string">"FullControl"</span> <span class="token operator">/</span><span class="token operator">&gt;</span>
<span class="token operator">&lt;</span><span class="token operator">/</span><span class="token maybe-class-name">AppPermissionRequests</span><span class="token operator">&gt;</span>

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.

hostforlifebanner

Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, CSS in SPFx, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting

SharePoint 2013 Hosting – HostForLIFE :: SPFx Form Customizer Extension To Customize SharePoint New/Edit/Display Form Of List/Libraries

Apr 25th

Posted by Peter in European SharePoint 2013 Hosting

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.

hostforlifebanner

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.

Step 1 – Install the latest preview version of SPFx

1
npm install <span class="token operator">@</span>microsoft<span class="token operator">/</span>generator<span class="token operator">-</span>sharepoint<span class="token operator">@</span>next <span class="token operator">--</span>global

Step 2 – Create the targeted List

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.

Step 3 – Create Project

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

1
yo <span class="token operator">@</span>microsoft<span class="token operator">/</span>sharepoint
ActionScript

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.

Step 5 – Modify render Method

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

1
2
3
4
<span class="token keyword keyword-public">public</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> React<span class="token punctuation">.</span>ReactElement<span class="token operator">&lt;</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token operator">&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword keyword-return">return</span> <span class="token operator">&lt;</span><span class="token class-name">div</span> className<span class="token operator">=</span><span class="token punctuation">{</span>styles<span class="token punctuation">.</span>firstCustomizer<span class="token punctuation">}</span><span class="token operator">&gt;</span>Hello World<span class="token range operator">..</span><span class="token range operator">..</span><span class="token range operator">..</span><span class="token range operator">..</span><span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

Step 6 – Test the configuration

Go to command prompt again and run

1
gulp serve

It should open the browser with the below screen,

Click on Load Debug Scripts, if it loads correctly, we will see the below screen.

Step 7 – Modify Code to Create a new Entry in the SP list

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

1
npm install <span class="token operator">@</span>pnp<span class="token operator">/</span>sp<span class="token operator">@</span><span class="token number">2.11</span><span class="token number">.0</span>

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.

1
2
3
4
5
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> sp <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">"@pnp/sp"</span><span class="token punctuation">;</span>
<span class="token keyword module keyword-import">import</span> <span class="token string">"@pnp/sp/webs"</span><span class="token punctuation">;</span>
<span class="token keyword module keyword-import">import</span> <span class="token string">"@pnp/sp/lists"</span><span class="token punctuation">;</span>
<span class="token keyword module keyword-import">import</span> <span class="token string">"@pnp/sp/items"</span><span class="token punctuation">;</span>
<span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">IStackTokens</span><span class="token punctuation">,</span> <span class="token maybe-class-name">MessageBar</span><span class="token punctuation">,</span> <span class="token maybe-class-name">PrimaryButton</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Stack</span><span class="token punctuation">,</span> <span class="token maybe-class-name">TextField</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">'office-ui-fabric-react'</span><span class="token punctuation">;</span>

Replace render method to add controls

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<span class="token keyword keyword-public">public</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> React<span class="token punctuation">.</span>ReactElement<span class="token operator">&lt;</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token operator">&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword keyword-return">return</span> <span class="token operator">&lt;</span><span class="token class-name">div</span> className<span class="token operator">=</span><span class="token punctuation">{</span>styles<span class="token punctuation">.</span>firstCustomizer<span class="token punctuation">}</span><span class="token operator">&gt;</span>
       <span class="token operator">&lt;</span>TextField <span class="token class-name">required</span> onChange<span class="token operator">=</span><span class="token punctuation">{</span>evt <span class="token operator">=&gt;</span> <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">updateTitleValue</span><span class="token punctuation">(</span>evt<span class="token punctuation">)</span><span class="token punctuation">}</span> <span class="token keyword keyword-value">value</span><span class="token operator">=</span><span class="token punctuation">{</span><span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>itemObject<span class="token punctuation">.</span>title<span class="token punctuation">}</span> label<span class="token operator">=</span><span class="token string">"Add Title"</span> <span class="token operator">/</span><span class="token operator">&gt;</span>
       <span class="token operator">&lt;</span>TextField <span class="token class-name">required</span> onChange<span class="token operator">=</span><span class="token punctuation">{</span>evt <span class="token operator">=&gt;</span> <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">updateDescriptionValue</span><span class="token punctuation">(</span>evt<span class="token punctuation">)</span><span class="token punctuation">}</span> <span class="token keyword keyword-value">value</span><span class="token operator">=</span><span class="token punctuation">{</span><span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>itemObject<span class="token punctuation">.</span>Desc<span class="token punctuation">}</span> label<span class="token operator">=</span><span class="token string">"Add Description"</span> multiline<span class="token operator">/</span><span class="token operator">&gt;</span>
 
      <span class="token operator">&lt;</span>br<span class="token operator">/</span><span class="token operator">&gt;</span>
 
      <span class="token operator">&lt;</span>Stack <span class="token class-name">horizontal</span> tokens<span class="token operator">=</span><span class="token punctuation">{</span>stackTokens<span class="token punctuation">}</span><span class="token operator">&gt;</span>
      <span class="token operator">&lt;</span><span class="token class-name">PrimaryButton</span> text<span class="token operator">=</span><span class="token string">"Create New Item"</span> onClick<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">createNewItem</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">}</span>  <span class="token operator">/</span><span class="token operator">&gt;</span>
      <span class="token operator">&lt;</span><span class="token class-name">PrimaryButton</span> text<span class="token operator">=</span><span class="token string">"Reset"</span> onClick<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">resetControls</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">}</span>  <span class="token operator">/</span><span class="token operator">&gt;</span>
    <span class="token operator">&lt;</span><span class="token operator">/</span>Stack<span class="token operator">&gt;</span>
 
      <span class="token operator">&lt;</span>br<span class="token operator">/</span><span class="token operator">&gt;</span>
      <span class="token punctuation">{</span><span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>showmessageBar <span class="token operator">&amp;&amp;</span>
             <span class="token operator">&lt;</span><span class="token class-name">MessageBar</span>   onDismiss<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>showmessageBar<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">}</span>
                dismissButtonAriaLabel<span class="token operator">=</span><span class="token string">"Close"</span><span class="token operator">&gt;</span>
                <span class="token string">"Item saved Sucessfully..."</span>
            <span class="token operator">&lt;</span><span class="token operator">/</span>MessageBar<span class="token operator">&gt;</span>
      <span class="token punctuation">}</span>
 
    <span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

Create a State interface to hold values from controls, you can add below where IFirstCustomizerProps is declared.

1
2
3
4
5
<span class="token comment">//create state</span>
export <span class="token keyword keyword-interface">interface</span> <span class="token class-name">IFirstFormCustomizerState</span> <span class="token punctuation">{</span>
  showmessageBar<span class="token punctuation">:</span>boolean<span class="token punctuation">;</span> <span class="token comment">//to show/hide message bar on success</span>
  itemObject<span class="token punctuation">:</span>any<span class="token punctuation">;</span>
<span class="token punctuation">}</span>

Add below line below state declaration 

1
<span class="token keyword keyword-const">const</span> stackTokens<span class="token punctuation">:</span> IStackTokens <span class="token operator">=</span> <span class="token punctuation">{</span> childrenGap<span class="token punctuation">:</span> <span class="token number">40</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>

Modify FirstFormCustomizer class to use State and then create a constructor

1
2
3
4
5
6
7
8
9
10
export <span class="token keyword keyword-default">default</span> <span class="token keyword keyword-class">class</span> <span class="token class-name">FirstFormCustomizer</span> <span class="token return-type class-name">extends</span> React<span class="token punctuation">.</span>Component<span class="token operator">&lt;</span>IFirstCustomizerProps<span class="token punctuation">,</span> IFirstFormCustomizerState<span class="token operator">&gt;</span> <span class="token punctuation">{</span>
  <span class="token comment">// Example formatting</span>
  <span class="token comment">// constructor to intialize state and pnp sp object.</span>
  <span class="token function">constructor</span><span class="token punctuation">(</span><span class="token named-parameter punctuation">props</span><span class="token punctuation">:</span> IFirstCustomizerProps<span class="token punctuation">,</span><span class="token named-parameter punctuation">state</span><span class="token punctuation">:</span>IFirstFormCustomizerState<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token function">super</span><span class="token punctuation">(</span>props<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state <span class="token operator">=</span> <span class="token punctuation">{</span>showmessageBar<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">,</span><span class="token named-parameter punctuation">itemObject</span><span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
    sp<span class="token punctuation">.</span><span class="token function">setup</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
      spfxContext<span class="token punctuation">:</span> <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>props<span class="token punctuation">.</span>context
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

Add below 4 methods to handle the logic to save state, save in sp list, and reset controls

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
<span class="token keyword keyword-private">private</span> <span class="token keyword keyword-async">async</span> <span class="token function">createNewItem</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword keyword-const">const</span> iar<span class="token punctuation">:</span> any <span class="token operator">=</span> <span class="token keyword keyword-await">await</span> sp<span class="token punctuation">.</span>web<span class="token punctuation">.</span>lists<span class="token punctuation">.</span><span class="token function">getByTitle</span><span class="token punctuation">(</span><span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>props<span class="token punctuation">.</span>context<span class="token punctuation">.</span>list<span class="token punctuation">.</span>title<span class="token punctuation">)</span><span class="token punctuation">.</span>items<span class="token punctuation">.</span><span class="token keyword keyword-add">add</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
      Title<span class="token punctuation">:</span> <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>itemObject<span class="token punctuation">.</span>title <span class="token operator">+</span> <span class="token keyword keyword-new">new</span> <span class="token constructor-invocation class-name">Date</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
      <span class="token named-parameter punctuation">Description</span><span class="token punctuation">:</span> <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>itemObject<span class="token punctuation">.</span>Desc
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>iar<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>showmessageBar<span class="token punctuation">:</span><span class="token boolean">true</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token comment">//this.props.onSave();</span>
  <span class="token punctuation">}</span>
 
  <span class="token keyword keyword-private">private</span> <span class="token function">updateTitleValue</span><span class="token punctuation">(</span>evt<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token class-name"><span class="token keyword keyword-var">var</span></span> item <span class="token operator">=</span> <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>itemObject<span class="token punctuation">;</span>
    item<span class="token punctuation">.</span>title <span class="token operator">=</span> evt<span class="token punctuation">.</span>target<span class="token punctuation">.</span><span class="token keyword keyword-value">value</span><span class="token punctuation">;</span>
    <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
      itemObject<span class="token punctuation">:</span> item
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
 
  <span class="token keyword keyword-private">private</span> <span class="token function">updateDescriptionValue</span><span class="token punctuation">(</span>evt<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token class-name"><span class="token keyword keyword-var">var</span></span> item <span class="token operator">=</span> <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>itemObject<span class="token punctuation">;</span>
    item<span class="token punctuation">.</span>Desc <span class="token operator">=</span> evt<span class="token punctuation">.</span>target<span class="token punctuation">.</span><span class="token keyword keyword-value">value</span><span class="token punctuation">;</span>
    <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
      itemObject<span class="token punctuation">:</span> item
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
 
  <span class="token keyword keyword-private">private</span> <span class="token keyword keyword-async">async</span> <span class="token function">resetControls</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token class-name"><span class="token keyword keyword-var">var</span></span> item <span class="token operator">=</span> <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>itemObject<span class="token punctuation">;</span>
    item<span class="token punctuation">.</span>title <span class="token operator">=</span> <span class="token string">""</span><span class="token punctuation">;</span>
    item<span class="token punctuation">.</span>Desc <span class="token operator">=</span> <span class="token string">""</span>
    <span class="token keyword keyword-this">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
      itemObject<span class="token punctuation">:</span> item
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

Explanation about code

  • So here we are adding two controls Title and Description from the user and associating these controls with the state object to hold its value, onChange method on these controls takes care of saving the value to State.
  • Then we have added two buttons – one to Save and create a new items and the Reset button to reset the values in controls.
  • Create new item button click will call the method createNewItem which uses PNP js to save the data from state to create a new entry in list.
  • If you would have noticed we have used this.props.context.list.title to target the list name, so here we are using the context object from FormCustomizer which gives us objects and context on which the form Customizer is running.
  • There are 3 important attributes that would be important for developers to
    • this.props.displayMode –  this will help us identify if the form is in new, edit or display mode and we can use this to control our logic, please note as we are debugging using gulp serve for now this will always be new
    • this.props.context.list – this provides us the list object on which the form customizer is running. it has 3 attributes which are list title, list GUID and list server relative url.
    • this.props.context.itemId – this will provides us itemId on which current form is opened, this will be applicable when displayMode would be “Edit” or “Display”

Step 8 – Test the latest 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…

Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, CSS in SPFx, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting

SharePoint 2013 Hosting – HostForLIFE :: Check If The User Is Active

Apr 21st

Posted by Peter in European SharePoint 2013 Hosting

Recently, I had a requirement to construct the OneDrive URL from the email address. As many of us know, OneDrive is a cloud storage service provided by Microsoft, which lets the user store up to 25 TB. Users are required to have a proper subscription (E1, E3, E5, etc) to utilize this service.
A couple of points to note, if you observe the URL of the One Drive for an organization, let’s consider Contoso. If the email of the user is vinay.deep@contoso.com, (usually the email address will be in the format of firstname.lastname@organizationname.com). Then the one drive URL would be:hostforlifebanner
https://contoso-my.sharepoint.com/personal/vinay_deep_contoso_com/_layouts/15/OneDrive.aspx  
Let’s try understanding by breaking down the URL,
  • https://contoso-my.sharepoint.com – This will be in format https://[YOURORGNAME]-my.sharepoint.com
  • /personal – it is the managed path defined for all OneDrive sites
  • /vinay_deep_contoso.com – observe the email address is vinay.deep@contoso.com. It replaces special characters with ‘_’.
  • /_layouts/15/onedrive.aspx – it is constant to access one drive pages

Steps

To get the final OneDrive URL from the given email address, I have followed the below steps. At a glance,
  • Getting the user input from the command prompt,
  • Extracting the org name from the email.
  • Building the URL string from email, basically replacing special characters with underscore ‘_’.
  • Constructing the URL.
I have used Powershell with a regular expression to achieve the result set.
Step 1
Getting the user input from the command prompt. Just read the user input from the command prompt and storing in $Email variable,
1
$Email = Read-host "Enter the Email ID of user"

Step 2

Extracing the org name from the given email address. Here I am storing the regex pattern in variable called ‘$pattern’ and then finally matching with given email to extract the string which is organization name here,

1
2
$pattern = '(?<=\@).+?(?=\.)'  
$OrgName = [regex]::Matches($Email, $pattern).Value

Step 3

Building the One Drive string from the email. To replace the special character, I have written the function here called ‘Construct-OneDriveString’ from the given email.

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  
}

Step 4
Finally, constructing the OneDrive URL from the values generated from above steps. We have got the OneDrive string and organization name, which is enough to build the URL.
1
$OneDriveUrl = "https://$OrgName-my.sharepoint.com/personal/" + $OutputString + "/_layouts/15/onedrive.aspx"
Complete Script
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  
    }  
}

In this script, after completing the construction of the OneDrive URL, I am also checking the connection to One Drive by using Invoke-WebRequest function, which is built in a function used to invoke a web request to any https/http URLs and have the response back.

If the resultant OneDrive URL is valid, the user will be given a success message called ‘connection verified’.
If the resultant OneDrive URL is not valid, the user will be given a failure message called ‘URL doesn’t exist.
Conclusion
Thus, in this article, we have seen how to construct the OneDrive URL from the user’s email input. Hope you find this article useful.
Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, CSS in SPFx, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting

SharePoint 2013 Hosting – HostForLIFE :: Files To Be Committed To Source Control In SPFx Projects

Apr 14th

Posted by Peter in European SharePoint 2013 Hosting

Introduction

When working with SPFx projects, often time we might think of following questions

  • How do I share the source code with other team members?
  • What are the files to be checked into the source control repository like GitHub, Azure DevOps etc.

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.hostforlifebanner

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.

SPFx Folder Structure

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.

  • lib
  • dist
  • release
  • temp
  • node_modules

Please refer to article, code check-in using git commands that tells the steps to check in the code to source control.

Steps to run the SPFx solution

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.

  • dist
  • lib
  • node_modules
  • release
  • temp

 

Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, CSS in SPFx, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting
12345»102030...Last »
  • BLOGROLL

    • ASP.NET BLOG
    • ASP.NET MVC BLOG
    • Christian BLOG
    • Cloud Hosting ASP.NET
    • Europe Cloud Linux Hosting
    • HostForLIFE Blogspot
    • HostForLife.eu
    • Hosting Cheap ASP.NET
    • IIS BLOG
    • Silverlight BLOG
    • Windows ASP Hosting Review
    • Windows BLOG
  • Featured On

    • Best Windows Hosting ASP.NET
    • Cheap Hosting ASP.NET
    • Cheap Hosting Windows
    • Cloud Hosting ASP.NET
    • Discount Windows Hosting
    • Full Trust Hosting ASP.NET
    • Hosting For Ecommerce
    • Hosting Review ASP.NET
    • I Host Azure
    • Reliable Hosting ASP.NET
    • Review Hosting ASP.NET
    • Windows Hosting Bulletin
    • Windows Hosting Leader
    • Windows Web Hosting Review
  • Tags

    Belgium Sharepoint 2013 Hosting Best sharepoint 2013 hosting Cheap and recommended sharepoint hosting cheap european sharepoint 2010 hosting cheap european sharepoint server 2010 hosting cheap europe sharepoint 2013 hosting cheap sharepoint 2010 europe hosting cheap sharepoint 2010 foundation hosting CSS in SPFx european sharepoint 2010 hosting European Sharepoint 2013 Hosting europe sharepoint 2013 hosting Europe Sharepoint Hosting fast SharePoint 2013 Hosting France Sharepoint 2013 Hosting free SharePoint 2013 Hosting Germany Sharepoint 2013 Hosting HostForLife HostForLife.eu Hosting cheap european sharepoint server 2010 hosting Hosting cheap europe sharepoint 2013 hosting Hosting europe sharepoint 2013 hosting Hungary Sharepoint 2013 Hosting india SharePoint 2013 Hosting Madrid Sharepoint 2013 Hosting Netherlands sharepoint 2013 hosting Norway Sharepoint 2013 Hosting Portugal Sharepoint 2013 Hosting recommended SharePoint 2013 Hosting Russia Sharepoint 2013 Hosting sharepoint 2010 europe hosting sharepoint 2010 foundation hosting sharepoint 2013 hosting SharePoint 2013 Hosting belgium SharePoint 2013 Hosting germany SharePoint 2013 Hosting Italy SharePoint 2013 Hosting netherlands SharePoint 2013 Hosting poland SharePoint 2013 Hosting review switzerland SharePoint 2013 Hosting UK SharePoint Hosting 2013 Paris Server Spain Sharepoint 2013 Hosting tips SharePoint 2013 Hosting Top Sharepoint 2013 hosting trick SharePoint 2013 Hosting
RSS Feeds XHTML 1.1 Top