Tuesday, November 24, 2020

How to add custom URL to Modern SharePoint List

 


In this article, I will show you how to add a custom link to SharePoint Modern List thanks to the new SharePoint List View Formatting.  Earlier If we want to do this kind of task we need to add JSLink JavaScript.

So following code will show you how to do it

{

   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",

   "elmType": "a",

   "txtContent": "@currentField.desc",

   "attributes": {

      "href": "@currentField",

      "target": "_blank"

   }

}

If you are gone through the code snippet it is adding "a href "HTML tag to SharePoint List. It represents the above JSON to HTML it will look like as follows

<a href='@currentField' target='_blank'>@currentField.desc</a>

in elmType it will define the tag to which we are asked to add an element to the list view. Then the txtContent text is the Link text that shows to you. @currentField.desc is return the value of the field. finally, in the attributes section, it defines the <a> tag attributes. In this scenario, it adds the href and target attributes.


In this post, I have explaining how to add current list item link to the modern SharePoint list view if you need to add a static URL need to replace textContent and href in the attribute section.

Tuesday, August 6, 2019

_spPageContextInfo in JavaScript object model

What is _spPageContextInfo SharePoint JavaScript Object Model?

In JavaScript Object Model _spPageContextInfo is a main object use to key values like user name, siteurl, userid,etc. 

  • _spPageContextInfo.webabsoluteurlAbsolute URL of the current Web
  • _spPageContextInfo.userid - User Id of login user
  • _spPageContextInfo.userloginname - user name of login user

You can learn more about the _spPageContextInfo for followings blog codesharepoint.com

In some occasions  "_spPageContextInfo is not defined" error occurs in above error explain in above also

Saturday, January 17, 2015

Sunday, March 24, 2013

WebTemplate’s in SharePoint 2010


It is a New Feature Introduce in SharePoint 2010 can use as a Sandbox solution architecture
* Its allows deployment at site collection level
* Most of "Site Definitions" features are in the web template
* Web templates were based on existing site definition
* It Does not support Document Templates
* Only one Configuration
* It is best approach to control environment

WebTemplate Element

It specifies the default behavior the template
There are 3 required attributes
    - BaseTemplateID
    - BaseTemplateName
    - BaseConfigurationID
    - Name
Optional Attribute
    - Titke
    - AlternateCssUrl
    - CustOmJS

Onet.xml

It contain NavBars and Configuration Elements but not ListTemplate, DocumentTemplate, Modules, ServerEmailFooter
like Site Definition

One Configuration

Some attributes of project are superseded by WebTemplate attribute

It use features instead of Module

Sunday, September 9, 2012

Sunday, October 9, 2011

Retrieving the SharePoint List

There are two types of data retrieving in the SharePoint one method is using the SharePoint Web Service and other method is Using SharePoint dll. Today I am doing the second method, To use this method you need to do development in the SharePoint server or else that you can develop your own machine and deploy it in the machine and check but you are not able to debug it.

Saturday, October 8, 2011

How to add item to Sharepoint List

In this article I will show you how to add record to Sharepoint List using Sharepoint web part. The list name is ContactUs and following are the field to fill “Name”,” Email”, “WebSite”, “Telephone”, “Company”, “JobRole”,” Comment”, “How_do_you_hear “ and “UseSocialSite”

Friday, October 7, 2011

Wednesday, October 5, 2011

CRM2011 Data Filtering and retrieve

Following code illustrate how to Filter the data in the CRM and retrieve data from it in following code I have Select "Paidamount " form "Eventbooking" Entity for that I need to satisfy following criteria 
PaidAmount should not null, Bookingstatus should be 2, StatusCode should be 1 and event id must have to equal to provide one of the top 

Tuesday, October 4, 2011

Monday, October 3, 2011

Wednesday, September 21, 2011

Resolve problem in Master Pages Image Path

Hi all in ASP.net Master pages some time behave like weird. Because I have create some pages and put into a folder  and there is separate folder to images but when it is loaded imagers doesn’t load in some pages. I have tried using both ways  “../../images/logo.jpg” and “~/images/logo.jpg”  but I couldn’t make it happen finally I search it in the “Google”

Tuesday, September 6, 2011

Friday, August 26, 2011