Solved

display of a external content type using SPServices

Posted on 2013-01-15
2
1,019 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Parsing this XML works but the other one doesn't 9 26
SQL Server Resume 5 44
SQL Select Query help 1 34
Sql case statement to calculate totals 5 32
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

679 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