Solved

display of a external content type using SPServices

Posted on 2013-01-15
2
973 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now