<script>
var v = GetLatestSubInvestmentID();
function GetLatestSubInvestmentID()
{
var myQuery = "<Query><Where><IsNotNull><FieldRef Name='Title' /></IsNotNull></Where><OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy></Query>";
$().SPServices({
webUrl: "http://skl241:25625/sites/InvestmentDB/",
operation: "GetListItems",
async: false,
listName: "Sub Investment IDs",
CAMLQuery: myQuery,
CAMLRowLimit:1,
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='InvestmentInfo' /></ViewFields>",
completefunc: function (xData, Status)
{
$(xData.responseXML).SPFilterNode("z:row").each(function()
{
vGetLatestSubInvestmentID= $(this).attr("ows_InvestmentInfo");
$("input[Title='Total Amount Alloted']").val(vGetLatestSubInvestmentID);
}//End of completefunc
});//End of SPServices
return vGetLatestSubInvestmentID;
}//End of GenerateSubInvestmentID
</script>
No comments:
Post a Comment