Tuesday, November 27, 2018

Screen Recorder as a GIF file



Just found one excellent tool to make screen recorder as a gif. It will capture your curser movement and create one GIF file. Here is the Link: https://www.screentogif.com/

Fantastic tool to create tutorial videos or may be steps to reproduce one bug etc.

Wednesday, April 25, 2018

How to use CAML Query in PowerShell to excute any operation

If you want to delete (or any operation) multiple Items from a list based on certain condition then you can refer below PowerShell command where we can use CAML query to get exact items which we need to delete. Most of the time I found that the developers write PowerShell command which get all the items then Check the condition and delete the items. If you have large number items in list then it will get much time to execute.

Add-PSSnapin Microsoft.SharePoint.Powershell -ea SilentlyContinue
$web = get-spweb "[Site URL]"
$list = $web.lists["List Name"]
$ValueToCompare = "[Value To Compare]"
$FieldToCompare = "[Field Name To Compare]"
$query = New-Object Microsoft.SharePoint.SPQuery
$query.ViewAttributes = "Scope='Recursive'"
$query.RowLimit = 1000
$caml='<Where> <Eq> <FieldRef Name="'+$FieldToCompare+'" /><Value Type="Text">'+$ValueToCompare+'</Value> </Eq> </Where>'
Write-Host $caml
$query.Query = $caml
$query.ViewFields = "<FieldRef Name='ID'/>"
$query.ViewFieldsOnly = $true
do
{
  $listItems = $list.GetItems($query)
  $query.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
  foreach($item in $listItems)
  {
    Write-Host "Deleting Item - $($item.Id)"
    $list.GetItemById($item.Id).delete()
  }
}
while ($query.ListItemCollectionPosition -ne $null)  


Sunday, April 15, 2018

How to copy text from image - The One Note Way

In my opinion One Note is one of the Powerful tool comes in Office package but we rarely use those features. Here is one example of that.

In my last project I was working on an auditing software where client asks us to refer another Android app which was in Dutch language. There were many text so I was feeling pretty lazy to type all the text and implement it in our new app. To overcome this problem, I had taken the following steps:


  1. Take a screenshot of the old app from your mobile.
  2. Copy the screenshot in the desktop.
  3. Open the Microsoft One Note.
  4. Click on Insert from top menu. Then click on picture.  
  1. Then right click on the picture and select “Copy text from Picture”
  1. Then right click on a blank area and paste it.
  1. Finally, you will get only text from it. Rarely I found any error in this process.

Tuesday, February 20, 2018

PowerApps: Change Color of the button on select event

Use Case: In a quiz app, you need to put three buttons and based on the value of the button, color should be change. It should look like:




Or:




So how you do this? First, you need to put three buttons. In the “OnSelect” event of the button, you need to write following code:
UpdateContext({M1Q1Btn1ColorFlag:!M1Q1Btn1ColorFlag, M1Q1Btn2ColorFlag:false, M1Q1Btn3ColorFlag:false, Q1Ans:Button3.Text})




In addition, the “Fill” property of the button you need to put:
If(M1Q1Btn1ColorFlag = true, RGBA(0, 255, 0, 1), RGBA(230, 230, 230, 1))




Similarly, you need to do for “No” button as follows -
OnSelect: UpdateContext({M1Q1Btn1ColorFlag:false, M1Q1Btn2ColorFlag:!M1Q1Btn2ColorFlag, M1Q1Btn3ColorFlag:false, Q1Ans:Button2.Text})
Fill: If(M1Q1Btn2ColorFlag = true, RGBA(255, 0, 0, 1), RGBA(230, 230, 230, 1))


After the placement of the Buttons, you can put one Label to keep the response from the user. Later you can hide this label and use it at the event of the Finish Button to send it to SharePoint list or Excel.

Thursday, September 21, 2017



SharePoint JSOM Anonymous Access Error: GetItems on list id xxxx-xxxx-xxxx-xxxx blocked by administrator
Recently I was developing a functionality in SharePoint 2013 which queries the pages libraries, fetch the metadata of every pages and and display them in a table.

Problem:
It was working fine when the user is logged in, but when I access the site as anonymous user, it gave me error "The method GetItems on List with id xxxx-xxxx-xxxx-xxxx is blocked by administrator".

Solution:
So, after a quick googling I found the solution, that there are some restrictions in client object model for anonymous users. These restrictions are called client callable settings in SharePoint. The solution is removing the function GetItems from AnonymousRestrictedTypes using PowerShell:

$web = Get-SPWebApplication -Identity "http://YourWebUrl"
$web.ClientCallableSettings.AnonymousRestrictedTypes.Remove( [Microsoft.SharePoint.SPList],"GetItems")
$web.Update()

If you want to restore this restriction in future then you can run following command:

$web = Get-SPWebApplication -Identity "http://YourWebUrl"
$web.ClientCallableSettings.AnonymousRestrictedTypes.Add( [Microsoft.SharePoint.SPList],"GetItems")
$web.Update()



Wednesday, August 2, 2017

Get one year Developer account in O365 (E3 Account)

Good news for SharePoint online Developers!! Earlier, if you created Office 365 developer account then you only get to use this for next 30 days. Now Microsoft allows developer to create same developer account for 1 Year for free. It will be great opportunity for developers if they want to create some PoC  to showcase of your work and mention this in your resume. 

Here are the steps to follow:

  1. Go to Link: https://dev.office.com/devprogram
  2. You can see below screen. Click on “Join Developer Program”


3. You will redirect the following page:

4          4. Fillup the form. You will get one mail like the following screen:

5        4. Click on Redeem Today you will redirect to following page:

6          5. After filling the form, you will get 1 Year free license of O365. Happy Developing!!

Thursday, September 29, 2016

How to Allow cross domain access in SharePoint 2013 Modal Dialog Box

Consider one scenario: You have two web applications. There is a page in one web application (let’s say Source web application). In this page there is button. On click the button you need to open a Modal Dialogue Box. In this Modal Dialogue box, you called a page located in another web application. If you try this, you will get bellow error:

"Refused to display 'http://contoso/pages/home.aspx' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'."

To get rid of this problem, add the below line in the master page of the source web application:
<!--SPM:<WebPartPages:AllowFraming runat="server" />-->

It should look like below screen:


Next you need to download the following wsp from CodePlex:

This is a Farm Level Feature. Download and install it in the central Admin and enable the feature for both the web application. Now you can open the page without any problem.


Cheers!!