Hi all:
I have code that would loop through a recordset depending on how many id's are selected. I would like to pop open a window and print recordset out.
does anyone know how to do this?
Thanks
It is a button firing this off...
I have code that would loop through a recordset depending on how many id's are selected. I would like to pop open a window and print recordset out.
Code:
/ DECLARE CONSTANTS
var POS_ID="{!Case.Id}";
var POP_MSG="";
function getApps()
{
// This function retrieves the User selected records
try
{
var recordIds = {!GETRECORDIDS($ObjectType.Case)};
//
//my if then statement
if (recordIds.length > 0)
{
var records = sforce.connection.retrieve("Id,Ticket_Origin__c, Subject, Status, Reason_Detail__c, Reason, Description, CaseNumber, Acct_Owner__c, AS400_Account_Number__c","Case",recordIds);
alert("You have select cases with Ids of " + recordIds);
}
else
{ POP_MSG += "\r\nNo Records Selected\r\n"; }
} catch (e){POP_MSG += "\r\nERROR\r\n" + e;}
return records;
}
function printall(records)
{
var str="";
for (i=0;i<records.length;i++)
{
str +='<tr><td>' + records[i].Id+ '</td><td>' + records[i].CaseNumber +'</td></tr>';
}
alert(str);
}
var records=getApps();
if (records !=null)
{
if (records.length >0) {
printall(records);
}
}
alert(POP_MSG);
Thanks
It is a button firing this off...