Solved

display of a external content type using SPServices

Posted on 2013-01-15
2
990 Views
Last Modified: 2013-01-15
Hello, i have got the following list which has been created already and it is called NotHereToday this list will be in charge of displaying the name and surname of the people not working Today in the office.  I also have the following code which sumarizes what I want to do but with a different list.. How can I make the following sample display the information I want. Two fields will be displayed preferred_name and surname

/* BIRTHDAYS AND LEAVE */

$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "TodaysLeaves",
    CAMLViewFields: "<ViewFields><FieldRef Name='full_name' /><FieldRef Name='leave_type' /></ViewFields>",
    completefunc: function (xData, Status) {
    

    
	  $(xData.responseXML).SPFilterNode("z:row").each(function() {

		if ($(this).attr("ows_leave_type") == "A") {
			leaveterm = "Annual Leave";
		} else if ($(this).attr("ows_leave_type") == "O") {
			leaveterm = "Other";
		}
		 else {
		    leaveterm = "Long Service";
		}

		 
var Listofonleave = "<span class='recordofperson'> "+ $(this).attr("ows_full_name") + "<span class='leavetype'>"+leaveterm +"</span></span>";
 
   	    $("#PeopleOnLeave").append(Listofonleave);
	 
      });

	  
    }
  });

Open in new window

0
Comment
Question by:jhonc66
  • 2
2 Comments
 

Accepted Solution

by:
jhonc66 earned 0 total points
ID: 38781358
I just finished editing it myself , and this is the answer

$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "NotHereToday",
    CAMLViewFields: "<ViewFields><FieldRef Name='preferred_name' /><FieldRef Name='surname' /></ViewFields>",
    completefunc: function (xData, Status) {
    

    
	  $(xData.responseXML).SPFilterNode("z:row").each(function() {

		var NotHereToday = "<span class='recordofperson'> "+ $(this).attr("ows_preferred_name")+" "+ $(this).attr("ows_surname");
 
   	    $("#NotHereToday").append(NotHereToday);
	 
      });
    }
  });

Open in new window

0
 

Author Closing Comment

by:jhonc66
ID: 38781361
I was able to come up with an answer
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server 2012 r2 - Sum totals 2 25
MSSQL Import .SQL files - Increase Import Speed 9 42
SQL server vNext 18 29
SQL invalid column name 5 13
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question