Header

Showing posts with label SharePoint Online. Show all posts
Showing posts with label SharePoint Online. Show all posts

Tuesday, 2 May 2023

Deferred in SharePoint JSON

How to use Deferred in SharePoint JSOM?

I'll demonstrate how to utilize Deferred in SharePoint Online today.
All functions in SharePoint operate asynchronously, however occasionally we must call a function after another has finished. Assuming we have two lists and must retrieve data sequentially from each, delayed is used in this scenario

Sunday, 14 July 2013

Get Data of current login user in Sharpoint




Get Data of current login user in Sharpoint
some time we need to get data according to current user.
Like items that has been created by current login user.

And there so many approach to do this but,
what I will recommend that never goes wrong.

  osb.Append("     <Where>")
  osb.Append("       <Eq>")
  osb.Append("        <FieldRef Name=""Author"" LookupId=""True"" />")
  osb.Append("        <Value Type=""Lookup""   >" &
                        SPContext.Current.Web.CurrentUser.ID & "</Value>")
  osb.Append("      </Eq>")
  osb.Append("   </Where>")


Just add this query and get what you wanted :D

Monday, 24 October 2011

How to get connected to a site in sharepoint.

////////////////////////////////////////
How to get connected to a site in sharepoint.
////////////////////////////////////////
1)
     Dim oWebsite As SPWeb = SPContext.Current.Web
2)
     Using oWebsiteRoot As SPWeb = SPContext.Current.Site.RootWeb
                ...
     End Using
3)
     Using oWebsite As SPWeb = SPContext.Current.Site.OpenWeb("Website_URL")
  ...
      End Using
4)
      Using oSiteCollection As New SPSite("http://server_name/")
         Using oWebsite As SPWeb = oSiteCollection.OpenWeb("Website_URL")
             Using oWebsiteRoot As SPWeb = oSiteCollection.RootWeb
                  ...
             End Using
         End Using
      End Using
5)
      Dim myWeb As SPWeb = SPContext.Current.Web
      Debug.WriteLine("MyWeb lists : ")
                        For Each aList As SPList In myWeb.Lists
                              Debug.WriteLine("************************************")
                              Debug.WriteLine("list Title (Display Name): " & aList)
                              Debug.WriteLine("list Title (Display Name): " + aList.Title)
                              Debug.WriteLine("list Root Folder Name: " + aList.RootFolder.Name)
                              Debug.WriteLine("************************************")
                         Next