Sunday 14 December 2014

HTML5 Cloud Application development with SharePoint and LightSwitch

This post consists lot of interesting key words SharePoint,Light Switch,Cloud Apps

Let me explain briefly about the Visual Studio Light Switch 
LS is a development environment designed to simplify  and shorten the development of business applications and data services.It makes easy to create data-centric business applications that can consume a variety of data sources and create clients that can run on a variety of devices. You can see the LS architecture in below link

http://msdn.microsoft.com/en-us/vstudio/gg491708


SharePoint <--> LS 

As you know very well in SharePoint 2013 every thing is an app so now we are going to develop the SharePoint<-->LS applications using vs 2013

open vs 13 file -->new project

it will ask for developer site url for debugging you can give on premises developer site or office 365 online


after creating you will see the below screen with lot of different files
  then add SharePoint list from external data 

after selecting sharepoint then click next it will ask for sharepoint site

then it will ask to select the entities


after selecting the entity the screen will become like this 


then implement the screens need for curd operations by selecting screens in the top

 add the required screens then click ok
and run the application it will become like this -->home screen which will display all screens
         

by clicking new  button in corner we will get add screen popup like this
 by clicking view   button we can view  the selected item
 by clicking edit button we can edit the selected item


Sunday 2 November 2014

Use Geolocation column to show map view within lists or libraries in sharepoint online


One of the best feature which i learned recent times is Geo-location field in Sharepoint online even we can do it in on-promises also
In-order to enable Geo-location field we need Share point online management shell even we can do it with coding also i tried with powershell. So u can download management shell from below link

https://support.office.com/en-us/article/Set-up-the-SharePoint-Online-Management-Shell-environment-7b931221-63e2-45cc-9ebc-30e042f17e2c?ui=en-US&rs=en-US&ad=US

after downloading the management shell open it from start with administrator privileges. and type the below command to connect with online
Connect-SPOService -Url https://example-admin.sharepoint.com -credential demo@example.onmicrosoft.com

it will ask password just type your online password





and type below powershell commands by replacing list and website url ,

$WebUrl = ‘https://example.sharepoint.com/sites/dev1
$EmailAddress = “demo@example.onmicrosoft.com
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($WebUrl)
$Credentials = Get-Credential -UserName $EmailAddress -Message “Please enter your Office 365 Password”
$Context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($EmailAddress,$Credentials.Password)
$List = $Context.Web.Lists.GetByTitle(“replaced with your list“)
$FieldXml = “<Field Type=’Geolocation’ DisplayName=’Location‘/>”
$Option=[Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldToDefaultView
$List.Fields.AddFieldAsXml($fieldxml,$true,$option)
$Context.Load($List)
$Context.ExecuteQuery()
$Context.Dispose()

if allow go well you will see the map view under views of specified list as shown below
you will see the office location column in list you specified

now we need to get the bing map key for displaying the maps you can get from below link
     http://www.bingmapsportal.com/
now update the above script with map key as shown below
$web = $Context.Web
$web.AllProperties["BING_MAPS_KEY"] ="insert your bing map key here
$web.Update()
$context.ExecuteQuery()
$Context.Dispose()

now you will see below screen in list
in map view we can see the clear view as shown below




Friday 19 September 2014

Design Manager Bug – SharePoint 2013 --add an app getting loading screen in sharepoint 2013

this issue will come when ever you will migrate share point 2010 to 2013 or if we create minimal master page or by creating new master page ---loading screen will appear/something went wrong 



solution for this is
Make sure you have all placeholders as below:

1. DeltaPlaceHolderLeftNavBar
2. PlaceHolderLeftNavBar
3. DeltaPlaceHolderPageTitleInTitleArea
4.  PlaceHolderPageTitleInTitleArea 

Also each of them should not be set to Visible=False


The code for the content placeholders are:
<SharePoint:AjaxDelta id="DeltaPlaceHolderLeftNavBar" BlockElement="true" runat="server">
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server">
</asp:ContentPlaceHolder>
</SharePoint:AjaxDelta
<SharePoint:AjaxDelta id="DeltaPlaceHolderPageTitleInTitleArea" runat="server">
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server">
</asp:ContentPlaceHolder><asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server" Visible="false"></asp:ContentPlaceHolder>
</SharePoint:AjaxDelta>

just copy above code to your html master page

Monday 11 August 2014

Redirection to a page on Info Path form submit button click

 just add the below script in your content editor web part

<script>
function pageLoad()
{
 setTimeout(setEventHandler,3000);
}
function setEventHandler()
{
 var btnSend = document.getElementById("ctl00_SPWebPartManager1_g_05feacdc_f33d_4745_9911_be9cad71a70c_FormControl0_V1_I1_B19");
 btnSend.onmouseup = function(){Button.OnClick(this, event); window.location='http://www.bing.com';};
}
</script>


replace the submit button id by clicking f12 options in your browser




Wednesday 14 May 2014

Synchronizing Excel Tables with SharePoint Lists

first open your blank excel sheet just enter two headings item and cost
some items like computer and cost

 then we need to put that columns as headings so go to insert tab then click table option we will get some popup just by clicking OK it will treat item and cost as headings

design tab will be appear in excel sheet
now we need to add some excel add in to excel by going to file options tab will appear
add in download url is  http://www.microsoft.com/en-us/download/details.aspx?id=9345
by clicking options addin tab will appear by clicking addins --->manage addins--->excel addins-->go
by clicking go button it will ask for browse your addin or select your addin you can browser the downloaded addin from your computer or else you can select it
by selecting addin we can see the option synchronize with sharepoint 

by clicking it will ask for sharepoint site url and list name by clicking publish it will publish that table to sharepoint
now if we go to sharepoint site we can see the list
by adding items to that list the upadated list items we can see in excel
by going to excel sheet table ---> synchronize option 
we see the updated list
as shown below













Wednesday 7 May 2014

how to restrict a document library to upload only specific file format in sharepoint

just go to sharepoint centeral admin

------> then click on security it will display option like below


by clicking define blocked file types  u will goes to below screen

just add the format like i did docx format if i upload the document like docx it wont allow u to upload that document it will show below screen


if any one knows how to do same thing in office 365 online let me know



Saturday 3 May 2014

good practice for asp.net mvc applications


just go to this link it is a microsoft site
http://www.microsoft.com/web/gallery/categories.aspx?category=eCommerce

by clicking install button










in browser by typing host url demo.magelia.com we will get the administrater panel
magelia providing three editions among them comunity edition is free and professional edition is free for 45 days in comunity edition only one store is possible and upto 99 products is possible

we need to download front demo site from above link
inorder to add category items we need to add products first by clicking the add new button
by clicking add new item we will get the above screen with product type and some other configurations
in above inventry option is for stock available are not we can provide that in inventory option
in above price option is for pricesing the product
  
we can add more options for products by using product types and product attributes




finally we will add the products to category like above



we can add the images from characterstics option are content option from tab
after adding all the products we nee to click on dataupdate button then it will forword to above screen then we need to click on update data button
all the updation is completed then it will reflects in home screen we can observe  in above screen