Error deploying ContentType with FieldRefs

Another Problem-Solution post, and this time it’s going to be quick on a problem you may face deploying a SharePoint feature in Visual Studio.

The error this time states: “Error occurred in deployment step ‘Activate Features’: Key cannot be null. Parameter name: key”.

Again, the error here is not descriptive and doesn’t give us a clue on what the problem is. What will help us is using the output window in Visual Studio to track where the problem occurred (I followed this technique and applied it to workflows in Nintex to troubleshoot problems there, view this post to know more about troubleshooting Workflows).

So the output in Visual Studio provides us with a step by step details on the deployment process, in my case the deployment errored on activating a feature that included only content types, so I know where to investigate now.

What I noticed in my xml that deploys the content type, is that there is a specific content type that references the fields this way:

<FieldRef ID=”{9EDAB26E-CC44-4027-AB05-CB44EA3A6F72}Name=”EmployerName“/>

<FieldRef ID=”{8406B0D9-9302-4BCD-917A-404558F3C9A0}Name=”CustomerFullName” />

<FieldRef ID=”{395B72D8-90D8-4A68-ACDC-C423B205B276}”  Name=”CustomerFeedback” ></ FieldRef>

The way that the CustomerFeedback field was deployed was different than the others, as you can notice it has a separate tag as the ending tag, and the deployment process expects that something has to be inside this field reference, but there is nothing, so it throws the given error.

Conclusion: When referencing FieldRef inside ContentType project item, make sure you don’t have a separate closing tag for the FieldRef.

Hope this little quick tip would help someone out there!

Basic operations in SharePoint with Excel

 

End users are the core foundation of SharePoint usage, SharePoint was made to serve end users, developers do custom solutions to serve end users, and admins make sure the environment is working fine so end users can do their work easily. One of the features that SharePoint provides out of the box, is the ability for end users to use the tools they already know, and integrate it with SharePoint, and one of these tools is Excel.​​ 

 

This blog post is targeted towards end users who are new to SharePoint and wondering how they can use Excel within SharePoint, so let's see some super easy steps on what you can do with SharePoint.​​ 

 

Let's say you are working on an Excel document locally on your computer, for me for example, let's say am working on a document listing partners for my company, my Excel workbook looks like this:​​ 

 

1 Title 
2 Fictional Company 1 
3 Fictional Company 2 
Address 
MTL 
MTL 
Number of Projects

 

 

Now I would like to have this in SharePoint as a list, so I can share it with others. When you want to import an Excel sheet do SharePoint, SharePoint will not import the whole document, it will ask you for a specific range that you may want to upload to it. For example, If you have an Excel workbook with columns A through J, you might want to upload the columns A to F only, so you don't have to create a new Excel sheet just for these columns. There are multiple ways to do so, but the easiest way is, to highlight the area that you want to upload to SharePoint​​ 

 

Fictional Company 1 
Fictional Company 2 
Address 
MTL 
MTL 
Number of Projects 
2

 

 

And then click​​ Formulas​​ from the ribbon, and choose​​ Define Name:​​ 

 

Formulas 
Text Date & 
Time • 
Library 
-itle 
Data 
Lookup & 
Reference • 
Review 
Math & 
View 
More 
Power Pivot Tell me what you want to do 
—x @ Define Na me 
Use in Formu 
Na me 
Trace P re 
Trace Del 
Trig • Functions • 
Manager Create from Selection Remove 
Defined Names

 

 

Add a descriptive name:​​ 

 

C:\Users\owner\AppData\Local\Temp\msohtmlclip1\02\clip_image004.png

 

 

And Save your document, and make sure to close it.​​ 

 

What did we just do? We have our Excel sheet as it is, we just gave a name to the selected area that you want to upload to SharePoint, that's it, nothing major.

 

Now to upload your document to SharePoint, you have to forget about all other browsers, and use​​ Internet Explorer, because the upload to SharePoint functionality requires a browser that supports​​ ActiveX​​ control, so you will have an error like this if you try to use Edge or Chrome:​​ 

 

technifier.sharepoint.com says: 
This feature requires a browser that supports ActiveX controls.

 

 

So open Internet Explorer, and select the gear icon, then choose​​ Add an app:​​ 

 

Change theme 
Office 365 settings 
Add an app 
Site conte 
Change the look 
Site settings

In the search box, you can type:​​ Excel, then you'll see "Import Spreadsheet" app, click it and give it a name, in my case I'll just name it: Our Partners, give it a description if you want, and click​​ browse, then choose your document, and hit​​ import. If you get an error that looks like this:​​ 

 

Message from webpage 
The specfied file is not a valid spreadsheet or contains no data to 
import.

Then you need to add the current SharePoint site to the list of trusted sites in Internet Explorer, to do so, click on the gear icon in Internet Explorer on the far top right corner:​​ 

 

Machine generated alternative text:
Print 
Zoom (100%) 
Saf ety 
Add site to Apps 
View downloads 
Manage add-ons 
F12 Developer Tools 
Go to pinned sites 
Compatibility View settings 
About Internet Explorer 
Ctrl+J

 

 

And choose​​ Internet Options, Open Security tab, and click Trusted Sites, then click Sites button:​​ 

 

 

Machine generated alternative text:
Genere!o Security Privacy Content Connections Programs 
Select a zone to Vien or change security settings. 
Internet Local Intranet Restricted 
sites 
T rusted sites 
This zone contains vvebsites that pu 
trust not to damage your computer or 
Advanced

 

 

 

Make sure to add the current SharePoint site URL, and click Add, then Close. Then try to import the document again. If it gave you the same error, then try restarting Internet Explorer, and repeat the steps before to​​ Import​​ from Excel sheet.​​ 

 

Now, once you click on​​ Import, your Excel document will open and you'll see a popup that looks like this:​​ 

 

Import to Windows SharePoint Services list 
Range Iype : 
Table Range 
Range of Cells 
Table Ran e 
Named Ranae

 

 

Choose​​ Named Range, and choose the Name you specified earlier, and hit​​ Import. Wait for the SharePoint magic to take place, and you'll see your Excel sheet uploaded to SharePoint:

 

Our Partners 
@ new item or edit this list 
All Items 
Title 
Find an item 
p 
Address Number of Projects 
Fictional Company 1 
Fictional Company 2

 

 

If you check the columns for this list, you'll see that SharePoint is smart enough to infer the types of columns, and it will create a Number column for our "Number of Projects" column:​​ 

 

Columns 
A column stores information about each item in the list The following columns are currently available in this list 
Column (click to edit) 
Title 
Address 
Number of Projects 
Modified 
Created 
Created By 
Modified By 
Type 
Single line of text 
Single line of text 
Number 
Date and Time 
Date and Time 
Person or Group 
Person or Group

 

 

 

 

You successfully uploaded a Range in your Excel workbook to SharePoint and created a list out of it! That's all good, and it's all basic stuff. Now let's try it backwards! Let's say you have a SharePoint list, that's called Our Partners, and you want to be able to view it in Excel locally, without opening the site. What can you do in this case? Remember that the Import process is just one time push from Excel to SharePoint, and it won't make any kind of connection between the document on your computer and the list.​​ 

 

Click on the​​ List​​ tab, and choose "Export to Excel"

 

Ccnnect to Export t 
Outlook Excel 
Open with Access 
Open with Project 
& Export 
Form Web Parts 
Edit List 
Customize in 
New Quick Step 
Customize List

 

 

​​ this will open a dialog asking you to either save it or open it, note this will not save or open an Excel file, it will open/save a .iqy file, which is a Web Query file, it will not contain any data, but it will hold a connection reference to your SharePoint list. You can choose to open it, and it will open in Excel, and Excel will ask you if you trust this source, for sure we trust it because it's coming from SharePoint, so click on Enable:​​ 

 

Microsoft Excel Security Notice 
Microsoft Office has identified a potential security concern. 
File Path: 
Data connections have been blocked. If you choose to enable data 
connections, your computer may no longer be secure. Do not enable 
this content unless you trust the source of this file. 
Enable 
Disable

 

 

Now you'll see the data coming in Excel and it looks like this:​​ 

 

Title 
2 Fictional Company 1 
3 Fictional Company 2 
Address Number of Projects Item Type Path 
MTL 
MTL 
5 Item 
2 Item 
sites/HaitiSchoolproject/Lists/Our Partners 
sites/HaitiSchoolproject/Lists/Our Partners

 

 

REMINDER: This is a .iqy file, it doesn't hold the actual data, it just gets the data from SharePoint and shows it to you, if you're offline, it will not be able to display your data. So what to do? We can save it as an Excel sheet now, click​​ Control + S​​ and save it somewhere on your computer.​​ 

 

Now we have our Excel sheet with the data locally, so we don't have to be connected to the internet to see the data .. But .. How can we get the latest data from SharePoint? Suppose that I am collaborating with other people, and they add data to this list, and I have this Excel file on my computer and am too lazy to open the browser and check the updates, I can click on the "Data" tab, and hit​​ Refresh:​​ 

 

Page Layout 
her Existing 
Formulas 
Review 
Show Queries 
From Table 
View Power Pivot 
Connections A 
Properties 
Query • Recent Sources 
Connections 
Refresh 
Edit Links 
All 
Connections 
Get & Transform 
Title 
dress Number of Projects Item Type Path 
5 Item 
2 Item 
sites/HaitiSchoolproj 
sites/HaitiSchoolproj

 

 

But.. Yes, another but.. What if I am too lazy to keep clicking​​ Refresh​​ to refresh my data? I can click on​​ Connections​​ - Just beside the Refresh button, and choose​​ Properties:​​ 

 

 

Review 
View 
Power Pivot 
Connections Al 
Design Tell me what you want to do 
Show Queries 
From Table 
Recent Sources 
Transform 
Properties 
Refresh 
Edit Links 
All 
Connections 
Clear 
Reapply 
Sort 
Filter 
Text to 
Flash Remove Data Consolidate Relationships Manage 
Advanced Columns 
Fill Duplicates Validation • 
Data Tools 
Data Model 
Add. 
Remove 
pr erties... 
Refresh 
Manage Sets... 
Close 
What-I f 
Analysis 
Sort & Filter 
acts Item Type Path 
5 Item 
2 Item 
sites/HaitiSchoolproject/Lists/Our Partners 
sites/HaitiSchoolproject/Lists/Our Partners 
Workbook Connections 
Name 
Description 
Last Refreshed 
Locations where connections are used in this workbook 
Click here to see where the selected connections are used

 

 

Then I can choose:​​ Enable background refresh, and specify that I want to refresh data when the file is opened:​​ 

 

Usage Definition 
Refresh control — 
Last Refreshed: 
Z] Enable background refresh 
Refresh every 60 
IV minutes 
Z] Refresh data when opening the file 
Remove data from the external data range before saving the workbook 
Z] Refresh this connection on Refresh All

 

Click OK and close the Excel sheet. Let's try it out, add a new entry in the SharePoint list:​​ 

 

 

Address 
Fictional Company 3 
Fictional Address 
Number of Projects 51

 

 

Then open your document again, it might ask you to Enable External Connections if it's the first time you open it after the previous configuration, so click​​ Enable Content:​​ 

 

SECURITY WARNING External Data Connections have been disabled 
Enable Content

 

 

Then the records added in SharePoint will appear in this document:​​ 

 

 

Title 
Address 
Number of Projects Item Type Path 
2 
4 
Fictional Company 1 MTL 
Fictional Company 2 MTL 
Fictional Company 3 Fictional Address 
5 Item 
2 Item 
5 Item 
sites/HaitiSchoolproject/Lists/Our Partners 
sites/HaitiSchoolproject/Lists/Our Partners 
sites/HaitiSchoolproject/Lists/Our Partners

 

 

 

Now we don't need to see the last 2 columns, am going to highlight them and right-click then click​​ Hide

 

 

 

Number of Projects Item TYE . 
5 Item 
2 Item 
5 tem 
Cut 
Copy 
Paste Options: 
Paste Special... 
Insert 
Delete 
Clear Contents 
Format Cells... 
Column Width... 
Unhide 
ject/Lists/Our Partners 
oject/Lists/Our Partners 
ject/Lists/Our Partners

 

 

 

Then save your document. That's it, now every time you open this Excel document, it will auto refresh from SharePoint and show you only the data that you need.​​ 

 

We learned in this post, how to get data from Excel into SharePoint as a list, how to give an Excel sheet a Named Range. We learned that Importing Data from Excel will require Internet Explorer as the importing process will require a browser that supports ActiveX controls. We learned how to pull data from SharePoint as a Web Query file (.iqy), which is a file that just connects to SharePoint and doesn't hold any real data, and if you want to save the data, you can save this file as an Excel Document (.xlsx), and we learned how to get the latest data from SharePoint without having to manually asking for it.​​ 

 

Set the Title column to be required in document libraries (Programmatically)

This is a quick post, that may sound like a straightforward task at the beginning, but may take a long time to figure it out.

If you have ever tried to change the Title column to be required in SharePoint list, you know that all what you needed to do is to get reference to the title column, and set it to required, then update, it may look something like this:

SPField titleField=list.Fields[“Title“];

titleField.Required= true;

titleField.update();

But it won’t be that straightforward in document libraries, after all, if you try to make it in the user interface, it won’t be straight forward also.

To make it clear, for example, try to create a document library, and try to create a custom list; in the custom list you will have the option of making the title either mandatory or not, but in the document library you will need to access the content type first, then making the title mandatory in that instance, but the purpose of the article this time is to how to do that programmatically. So here it is:

SPField titleField = list.Fields[“Title“];

SPContentType docCtType = list.ContentTypes[“Document“];

SPFieldLink fieldlink = docCtType.FieldLinks[titleField.Id];

fieldlink.Required =true;

docCtType.Update();

This way you will update the properties for the title column inside the document library.

Hope that helps.

M . D

PowerShell Error When Restoring Site Collection

SharePoint doesn’t allow the backup of a site collection and restore it in the same content database. If you backup a site collection and restore it, it will give you the following error.

So you need to make a new content database in the web application (in case the replication of the site collection at the same content database) so that the backed up site collection and the restored one are in different content database, but be careful to put the first database offline before you restore the new site collection.

 

HTML6 .. Already?

There have been a lot of buzz on the internet about the release of HTML6,  and seems like it’s going to replace a lot of stuff we used to do with JavaScript (if it’s approved) .. more than HTML5 could do.

The idea is to have <FIXTURES> tag in the Head tag of the HTML page, this Fixtures tag is a repository of code, each code block is called a model, and this model can either be static or it can be retrieved dynamically from SQL. These fixtures are then referenced in the body tag. So in the body tag of your HTML page you can reference chunks of HTML content that was declared previously in the Head tag, which can be static or dynamic, without needing JavaScript. This seems to be the replacement of the Single Page Application model (SPA) that’s currently implemented using some JavaScript frameworks such as Angular. So each part that will be changed will be inside a model in the Fixtures tag.

To read the proposal for the HTML6, have a look here:  https://lists.w3.org/Archives/Public/public-whatwg-archive/2015Mar/0071.html

Client Side Rendering in Forms In Depth

 

SharePoint gives new capabilities that developers can use to do same tasks required in previous versions of SharePoint using client side technologies. The main capability introduced in SharePoint 2013 is CSR (Client Side Rendering). The most common used method for CSR way is to manipulate users data for fields or list views.. But what about forms?

Someone is going to say: “Yes, SharePoint provides JS Link property for list forms as well, so what’s new with it?” Well, there’s more into it. Let’s see what can be done in list forms and to what extent we have the flexibility to do the forms we want.

Here we have a list called Customers, with a new form that looks like this:

 

csr1

Now, we want to make this look different, so we’ll be using JS Link for that. If you edit the newform page, and edit the web part:

csr2

Then go to Miscellaneous, you will find three important properties there:

  1. Form Template Name
  2. JS Link
  3. CSR Render Mode

 

csr3

 

We know that with JS Link we will be able to add a JS file and manipulate our form’s design. We also know that CSR Render Mode being set to standard it tells SharePoint to renders the form using CSR, and setting it to Server Render will make it depend on XSLT for that. But what about Form Template Name and its ListForm value?

If you had experience with SharePoint customization from previous versions specially for forms, you know that SharePoint uses technique called: Rendering Templates. Which is a group of predefined templates SharePoint has and uses them to render its pages and forms. If you have an on premises environment, you can go to this path: SharePoint Hive\TEMPLATE\CONTROLTEMPLATES, you will find a file called: DefaultTemplates.ascx:

csr4

 

If you open that file, you will find many controls with the tag: <SharePoint:RenderingTemplate.. . If you search for ListForm, you will find that it’s actually a rendering template that SharePoint uses to render its forms. But the good thing to know is, you can use another value which is CSRListForm. But what’s the difference?

The difference is that ListForm renders everything for you from SharePoint, like the layout for the form, the label names and so on, so if you need to use JS Link to style your list forms while you are using ListForm rendering template, you would need to use jQuery to restructure your HTML. So what if we use CSRListForm instead? Your list form would look like the following:

csr5

It will only render the fields for you, no labels, no buttons, no spaces between fields, nothing.. just fields. So you will have a clean output that you can play with in JS Link as much as you like! That’s neat!

Now let’s add a JS Link property to a .js file and try to style our form, there’s a file that my friend Muawiyah Shannak created and posted on MSDN, you can download the JS Link file here: https://code.msdn.microsoft.com/office/CSR-code-samples-11-Fully-54ebcaa6

Here we are declaring the objects necessary to form our view:

 

Inside the viewTemplate function we have the following code:

 

As can be seen, we’re constructing the HTML for our form, for this article and on MSDN, we made it static just for learning and explanation purpose. You can do whatever technique you prefer to form the HTML.

Three things to note about this code:

  1. Note how we have {{placeholders}} for each field we want to add in our HTML.
  2. Note also the getSPFieldRender function, I’ll explain that later on.
  3. The input button has an onclick function = SPClientForms.ClientFormManager.SubmitClientForm(‘{{FormId}}’) . This will allow us to use the out of the box capabilities to leverage the submit action and handling validations in the form.

Back to getSPFieldRender, this will go look into the form for each field by its internal name, and will get this field’s HTML, which will be replaced instead of the place holders such as {{TitleCtrl}}. This happens by using the CurrentFieldSchema and drilling down to the Field’s HTML from the ctx.Templates.Fields, As shown below:

 

Now, when apply this JS Link to our list form, SharePoint will render the fields, and place them instead of our placeholders, it would look like below:

csr6

Without using any jQuery hacks, you can now apply your designs to your list forms with the use of CSRListForms.

Hope that gave more understanding to List Forms and CSR.

Focused Inbox and Office 365 Emails

Microsoft introduced a feature called Clutter, that will route emails that don't seem important to the user to another folder called​​ Other. This was a good approach to help users focus on emails that would be important to them, and they can check the​​ Other​​ folder later on, however, users needed to visit another folder in order to see emails. That's why Microsoft introduced​​ Focused/Other​​ filters.

 

Now in Office 365, emails will have 2 filter tabs,​​ Focused​​ and Other. Important emails are going to appear in the​​ Focused​​ tab, and​​ other​​ emails will appear the other tab clearly. Now a lot of questions might come up when using these features, so let's review some of them:​​ 

 

  • How can a user control what emails appear in​​ other​​ and what emails appear in​​ focused​​ tab?​​ 

There are algorithms that teach the application what emails are good enough to appear in the​​ Focused​​ tab, so once a user moves an email from the​​ Other​​ tab to the​​ Focused​​ tab, Outlook will know that this email source is important for the user, and it'll make sure to make upcoming emails from this source appear in the​​ Focused​​ tab.

 

  • Can a user disable​​ this whole functionality in his Outlook application?

Yes, you can do so by selecting the filter dropdown beside the tabs, and unchecking the option to "Show Focused Inbox", as​​ shown in​​ the image below:​​ 

Focused Other 
Filter 
Next: No events for the ne 
V All 
Filter 
no-reply@sharepoi 
Raed Ibrahim mentioned y 
Raed Ibrahim: Hey @Moha 
Last week 
Microsoft 
Changes coming to Power 
Find the version that's best f 
Microsoft Online Se 
Unread 
To me 
Flagged 
Mentions 
Sort by 
Show as 
V Show Focused Inbox 
View your Office 365 Ente

 

 

Now let's have a look at this scenario, let's say you're working on a project inside SharePoint online, and one of your colleagues mentions you in the newsfeed inside that project portal, like the following image:​​ 

 

Newsfeed (9) 
Raed Ibrahim 
Hello @Mohamed D«halli I am excited to start on this project What's the plan? 
A few seconds ago Like Reply

 

You're going to receive an email from:​​ no-reply@sharepointonline.com,​​ ​​ But .. That email is going to appear only under the​​ Other​​ tab, and here's the catch, you won't receive notifications for emails that appear under the​​ Other​​ tab. By notifications I mean, you won't get notified when you're working in Office 365 that you received a new email:​​ 

 

Undo 
? Mohamed Dernalli 
Notifications 
Nothing new right now

 

Remember that the newsfeed web part only sends emails when you're mentioned.​​ 

 

So how do you solve this? You can't just ask each employee to disable the​​ Focused​​ functionality. You have 2 options in this case, either tell Exchange Online to route all emails from no-reply@sharepointonline.com to the​​ Focused​​ tab, or you can just disable the​​ Focused​​ inbox functionality on the tenancy level. Here's how we can do that:​​ 

 

 

Go to your Office 365 Exchange admin center, and from the left navigation, click "mail flow". Click the + sign to add a new rule:​​ 

 

permissions 
compliance management 
organization 
protection 
mail flow 
mobile 
public folders 
unified messaging 
Create a new rule... 
Apply rights protection to messages... 
ere are no Iti 
Apply disclaimers... 
Bypass spam filtering... 
Filter messages by size.. 
Generate an incident report when sensitive information is detected... 
Modify messages... 
Restrict managers and their direct reports... 
Restrict messages by sender or recipient... 
Send messages to a moderator... 
Send messages and save a copy for review...

 

 

A new window will appear, that looks like this:​​ 

 

new rule 
Name: 
*Apply this rule if... 
Select one 
*Do the following„. 
Select one 
Properties of this rule: 
Audit this rule with severity level: 
Not specified 
Choose a mode for this rule: 
@ Enforce 
O 
Test with Policy Tips 
O 
Test without Policy Tips 
More options... 
Riahts Manaaement Services (RMS) is a premium feature that requires an Enterorise Client Access License (CAL) or a RMS 
Save 
Cancel

 

 

 

 

Give the rule a name, let's say: "Other to Focused Emails Routing", then choose "The recipient address includes…" and click "Enter words…" and add the address you want to appear under​​ Focused​​ tab for all users, in this case no-reply@sharepointonline.com, then click the + sign and hit​​ OK.​​ 

 

 

specify words or phrases 
Cancel

 

 

 

Then go all the way down and click​​ "More options…":​​ ​​ 

 

new rule 
Name: 
*Apply this rule if... 
Select one 
*Do the following„. 
Select one 
Properties of this rule: 
Audit this rule with severity level: 
Not specified 
Choose a mode for this rule: 
@ Enforce 
O 
Test with Policy Tips 
O 
Test without Policy Tips 
More options... 
Riahts Manaaement Services (RMS) is a premium feature that requires an Enterorise Client Access License (CAL) or a RMS 
Save 
Cancel

 

 

In the "Do the following…" dropdown list, choose:​​ Modify the message properties > set ​​ a message header

 

the following„. 
Select one 
Select one 
Forward the message for approval.„ 
Redirect the message to.„ 
Block the message„. 
Add recipients„. 
Apply a disclaimer to the message... 
Modify the message properties.„ 
Modify the message security„. 
Prepend the subject of the message with.„ 
Notify the sender with a Policy Tip... 
Generate incident report and send it to„. 
Notify the recipient with a message.. 
remove a message header 
set a message header 
apply a message classification 
set the spam confidence level (SCL)

 

 

 

Set the header to:​​ X-MS-Exchange-Organization-BypassFocusedInbox​​ ​​ and the value to​​ true.​​ So the final result should be:​​ 

 

new rule 
Name: 
Other to Focused Emails Routing 
*Apply this rule if... 
The recipient address includes„. 
add condition 
*Do the following„. 
Set the message header to this value.. 
add action 
Except if... 
add exception 
Properties of this rule: 
Audit this rule with severity level: 
Not specified 
A for this 
Set the message header 'X-MS-Exchange-Organization- 
BypassFocusedInbOx' to the value •Enter text 
Save 
Cancel

 

 

Click save, and that's it. You can wait for a couple of minutes, and then test it. Upcoming emails will be delivered to the​​ Focused​​ tab, and you will receive notifications.

 

 

 

The other option would be to disable the​​ Focused​​ inbox functionality for all users in the tenancy, which leaves you with PowerShell. Once you connect to Exchange Online using PowerShell, you can run the following 2 commands:​​ 

 

Get-OrganizationConfig

Set-OrganizationConfig -FocusedInboxOn $false

 

 

I prefer doing the first​​ approach, and just routing the important emails to users'​​ Focused​​ tab, and give them the freedom to have it if they need.​​ 

 

 

 

 

 

 

 

Customizing Visual Studio Code

Many developers are using Visual Studio Code recently,​​ especially​​ open source developers who are enjoying its features, but some people don’t like the​​ font​​ (Monaco)​​ that comes by default with Visual Studio Code, or maybe they want to use bash commands in terminal. The good thing is, you can customize Visual Studio easily, because Visual Studio Code was built in JavaScript, so in order to customize it, you can modify a JSON file that comes with it. You can open the settings file by going to​​ File > Preferences > Settings, or by clicking​​ Control +​​ ,​​ 

 

 

It’ll open a JSON file where you can customize​​ many things, let’s say that we want to use bash commands inside of VSCode , to do this make sure you have bash installed, if not, the easiest thing to do is to go to:​​ https://git-scm.com/downloads ​​​​ and download the one for your OS.​​ 

Once bash is installed, you’re ready to customize VSCode to use it instead of command prompt. To do this, add this line in VSCode’s settings.JSON file:​​ 

"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",

 

So your file would look like this

 

 

Note that the value on the right side is the path to the bash executable file. Now if you click​​ Control​​ +​​ `​​ (backtick), the terminal will appear, and you will see​​ bash.exe​​ as the default tool to write your commands:​​ 

 

 

Let’s have another scenario, let’s say you want to​​ increase​​ the font size, you add something like this:​​ 

"editor.fontSize": 17

 

Now let’s try to change the font-family, to do so, add this:​​ 

"editor.fontFamily": "Lato"

 

So your file would look like this:​​ 

 

 

Now you’ll wonder, how can you know which fonts are available on your OS? For Windows you can execute these 2 commands in PowerShell:​​ 

[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

(New-Object System.Drawing.Text.InstalledFontCollection).Families

It will list all fonts you can use. Want to have extra fonts? You can get new​​ ones from​​ https://fonts.google.com​​ , after you download your font, you will have a font.zip file, extract it and you’ll see the fonts you downloaded as font-name.ttf. Right click on the font name and choose install.. and that’s it!​​ 

 

I hope this gave you an idea on how to customize VSCode to suite your needs, it’s an awesome editor and it’s worth considering when developing your applications.​​ 

 

 

Cool HTML5 stuff to try out

I’ve been busy lately with changing work and working on some projects, but I would like to share with you some nice HTML5 ideas that may inspire you and give your better understanding into what HTML5 is now capable of doing:

Make a wind for your Lion

Keyboard with sounds

Pomodoro Timer  (Just like some of Chrome’s Apps)

CSS Logo Animation

That would give you some ideas on what can be done with HTML5, CSS3 alone, without the need for custom development. Interesting how we can use these techniques now to build fancy stuff on top of SharePoint either online or on premises with the capabilities now available to us to leverage these techniques.

 

 

ReadOnly Vs. Hidden in FieldRef

Ever wanted to know the difference between the “ReadOnly” and “Hidden” attributes for the FieldRef? If your answer was yes, then keep reading..

You may get confused when you try to set the properties for a field in case you want to reference it in a content type, basically you use FieldRef to reference fields in your content type, then you may wonder when to use the “ReadOnly” and “Hidden” attributes.

Similarities:

The reason that makes you consider these attributes is that if you want to hide the item from the NewForm.aspx page. Both will hide your column from this page.

Differences:

The difference here is that “Hidden” will hide your field completely from SharePoint, you will be able to use this field in code though (so you may use it like a property for the content type to store specific values that won’t be shown in the browser), but you won’t see it in browser, you won’t even be able to see the field when you want to modify the view for the current list, it’s Hidden (as its name says!).

ReadOnly will hide the column from the NewForm.aspx page (so it’s a ReadOnly), but you can always modify the list’s view to show this field. So it’s not Hidden 100%.

So never use Hidden in case you want to be able to view the field later in the list!

That was a quick tip that would clear things out for some people out there!