Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: Access Page Owner contact email?

OK, I think I got the function. I'd love to know from the coders here if this could be written a little better, as it seems to me I'm querying the entire xml string for a single field and... I dunno is that a waste?

Anyway, obviously I can use that contactEmail however I want.

Next challenge is to be able to get the contactEmail if only the page contact (using people picker) is filled in—I saw on the documentation page that someone wrote in something about that, but I'm not sure how to mix the CAML. Anyway, trial and error....

$().SPServices({
	operation: "GetListItems",
	async: false,
	listName: "Pages",
	CAMLViewFields: "<ViewFields><FieldRef Name='PublishingContactEmail' /></ViewFields>",
	completefunc: function (xData, Status) {
		$(xData.responseXML).SPFilterNode("z:row").each(function() {if ($(this).attr("ows_PublishingContactEmail")) {var contactEmail = $(this).attr("ows_PublishingContactEmail");
				console.log(contactEmail);returnfalse;
			}
		});
	}
});


Viewing all articles
Browse latest Browse all 6517

Trending Articles