Skip to main content

SPServices Code Get Items From List in SharePoint 2013, 2010

$().SPServices({
        operation: "GetListItems",
        listName: "Episode Profile",
        CAMLViewFields: "<ViewFields>"+
         "<FieldRef Name='AirDate' /><FieldRef Name='Focus_x0020_ID' /><FieldRef Name='MR_x0020_Contact_x0020__x0023_1' /><FieldRef Name='MR_x0020_Contact_x0020__x0023_2' />"+
         "<FieldRef Name='PhotoEditor' /><FieldRef Name='AccountManager' /><FieldRef Name='Ingestor' /><FieldRef Name='Retoucher' /><FieldRef Name='Metadata' />"+
         "</ViewFields>",        
        CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID'/><Value Type='Number'>"+ epid +"</Value></Eq></Where></Query>",
       
        completefunc: function (xData, Status) {
         //alert(Status);
    $(xData.responseXML).SPFilterNode("z:row").each(function() {
//Set Focus ID

//var airdate = $(this).attr("ows_AirDate");
var EAirDate = $(this).attr("ows_AirDate");
$("input[Title='ADate']").val(EAirDate);
//alert(EAirDate);
    var focus = $(this).attr("ows_Focus_x0020_ID");
         if(focus==null)
focus='';
else
focus=Math.round(focus);
    $("input[Title='Focus ID']").val(focus);
   
    var AccountManager= $(this).attr("ows_AccountManager");
if(AccountManager!= null)
{
  setpeoplefield("Account Manager",AccountManager);
}
    var retoucher = $(this).attr("ows_Retoucher");
             if(retoucher != null)
             {               
                setpeoplefield("Retoucher",retoucher);
                }
                var PhotoEditor= $(this).attr("ows_PhotoEditor");
                if(PhotoEditor != null)
                {
               setpeoplefield("Photo Editor",PhotoEditor);
}
var Ingestor = $(this).attr("ows_Ingestor");
                if(Ingestor != null)
                {
                setpeoplefield("Ingestor",Ingestor);
                }
                var Metadata= $(this).attr("ows_Metadata");
if(Metadata!= null)
{
setpeoplefield("Metadata",Metadata);
}
                var mrcontact1 =  $(this).attr("ows_MR_x0020_Contact_x0020__x0023_1");
                if(mrcontact1 != null)
                {
setpeoplefield("MR Contact #1",mrcontact1);
                }
               
                var mrcontact2 =  $(this).attr("ows_MR_x0020_Contact_x0020__x0023_2");
                if(mrcontact2 != null)
                {
setpeoplefield("MR Contact #2",mrcontact2);
                }
});
}
});

Comments

Popular posts from this blog

Code : Responsive Full Master Page : Left Navigation , Top Menu header and Footer

<%-- SPG: This HTML file has been associated with a SharePoint Master Page (.master file) carrying the same name.  While the files remain associated, you will not be allowed to edit the .master file, and any rename, move, or deletion operations will be reciprocated. To build the master page directly from this HTML file, simply edit the page as you normally would.  Use the Snippet Generator at https://goodyearcorp.sharepoint.com/sites/SPOTest2/_layouts/15/ComponentHome.aspx?Url=https%3A%2F%2Fgoodyearcorp%2Esharepoint%2Ecom%2Fsites%2FSPOTest2%2F%5Fcatalogs%2Fmasterpage%2FRadarOnlineBrasil%2Emaster to create and customize useful SharePoint entities, then copy and paste them as HTML snippets into your HTML code.   All updates to this file will automatically sync to the associated Master Page.  --%> <%@Master language="C#"%> <%@Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoin...

Business-critical processes with SharePoint and SQL

SharePoint 2010 provides the ability to connect to backend business systems, surface business data in SharePoint and make it accessible by, and useful to, employees across the organization. Almost every company of significant size uses ERP and CRM solutions to run core business processes. Over time, companies have developed detailed practices around using such systems to support vertical disciplines within the organization (e.g. product planning, financial performance management, supply-chain management, etc.),  yet challenges remain with regard to driving visibility and collaboration, based on business data, across different disciplines and teams. These challenges stem from the fact that only a fraction of employees are licensed and trained to use those backend systems, and from the high cost and complexity of integrating such systems across different functions and teams. With SharePoint and SQL, once the relevant business data is surfaced in an enterprise-wide...

PowerShell - CSOM code to get SharePoint Online Sites Permission Report

#sharepoint online powershell permissions report Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"          $AdminSiteURL="https://m365x067565-admin.sharepoint.com/"   #Connect to SharePoint Online Admin Write-host "Connecting to Admin Center..." -f Yellow Connect-SPOService -url $AdminSiteURL -Credential (Get-Credential) #Get each site collection and users $Sites = Get-SPOSite -Limit ALL Foreach($Site in $Sites) { $SiteURL=$Site.Url   } #To call a non-generic method Load Function Invoke-LoadMethod() {     param(             [Microsoft.SharePoint.Client.ClientObject]$Object = $(throw "Please provide a Client Object"),             [string]$PropertyName       ...