$().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);
}
});
}
});
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
Post a Comment