Some thoughts on programming stuff

Month: January 2017

Troubleshooting errors using PowerShell in SharePoint

Today I would like to share with you an useful script to help on troubleshooting errors using PowerShell in SharePoint when some unexpected exception happens . This script can help you on tracing the exact cause of a bug in the application while relieving you from opening the entire log file and search for the error message in a not so productive way.

The SharePoint logs folder - Troubleshooting errors using Powershell in SharePoint
The SharePoint logs folder (Microsoft docs)

These logs are written by SharePoint and according to Microsoft, this is what you get from it:

“The Unified Logging Service (ULS) is the service that is responsible for keeping an eye on SharePoint and reporting what it finds. It can report events to three different locations:

  • SharePoint trace logs
  • Windows Event Log
  • SharePoint logging database

Where the event is logged (and if it’s logged at all) depends on the type of event, as well as how SharePoint is configured. The ULS is a passive service, which means that it only watches SharePoint and reports on it; it never acts on what it sees.”

Continue reading

Hide Content Query Web Part when empty

For those who want to hide Content Query Web Part when empty, in other words, when it returns not data, this post is for you! The solution won’t require you to dive into XSL world, it’s pure JavaScript. Basically you will drop the code code snippet to your pages and everything will work.

The Content Query Web Part (CQWP) is a great way to query data from other sites and present it inside one page. Content Query Web Part can be used with their default layouts or you can create some if want.

According to a Code Project article: ” This web part is rather nifty and it has many cool features. With the CQWP, you can now control how the content is displayed. We can use html tables to format the display however we wish. This article explains how to customize the CQWP using SharePoint 2010 without any code and deployment. “.

The Content Query Web Part - Hide Content Query Web Part when empty
The Content Query Web Part

Unfortunatelly, this post may be a little bit outdated because Microsoft reinforces that Content Search Web Part is a better option now. You can check this post when to use the Content Query Web Part or the Content Search Web Part in SharePoint.

Continue reading

Kickoff of my blog

Two years ago I abandoned my old Blogspot site where I used to talk about SharePoint, in Portuguese. I had to leave it behind due my opportunity to study abroad in Japan for one year, by a government program called Science without Borders that was letting Brazilian students to study in a country of their choice.

BUT NOW I’m back to Brazil and already settled into this wonderful culture, so I’ve decided to restart my old project and to try again building this website and publishing information that I find useful. Actually it won’t be just a common blog, because I’m also going to try some fancy stuff working on a personal website which I have more tools to invent and publish new content about not just SharePoint, but other topics. Well, I must admit that the main focus will be SharePoint and Office 365.

SharePoint    Office 365

You can see below my objectives:

  • Share some experiences that I will have working with SharePoint and .NET;
  • Discuss ideas about best practices for coding, performance and information architecture;
  • Promote some nice content from other bloggers or websites that usually help me in my daily tasks.

Well, I hope I can help you someday and that we can find ways to solve problems together too!

Here we go!

© 2024 wiliammbr's blog

Theme by Anders NorenUp ↑