+ Start a Discussion
satyamsatyam 

Passing set of record id to controller other than URL

Hi,

 

I want to pass selected record ids from custom list button to controller directly without passing through URL.

 

Because passing through URL giving error because IE URL can contain maxm 2047 characters and i have to use Internet explorer only for my work.

 

Can anyone please suggest any solution for this.I am redirecting to visualforce page and a controller is wriiten for that visualforce page.

 

Below is my custom button code:

 

    {!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")};


var records={!GETRECORDIDS($ObjectType.Area_Support__c )};

if(records[0]==null) {

alert("Please select atleast one record.");

} else {
var flag = false;


var psrecords=sforce.connection.retrieve("Id,Status__c,SAP_Transfer__c,Support_Type__c,Archieved__c","Area_Support__c", [records])



for(var i=0; i<psrecords.length; i++){

var recordId =psrecords [i];
var Arch=recordId.Archieved__c;
if(Arch=='true')
{
flag = true;
alert("You Can not do Mass change for Archived Area support!!");
break;
}else if(recordId.Status__c != 'Approved' &&Arch!='true'){
flag = true;
alert("Mass Change can be done only for Approved Area Supports");
break;

}else if(recordId.Support_Type__c=='Rebate' && recordId.Status__c == 'Approved' && recordId.SAP_Transfer__c=='Open' &&Arch!='true'){
flag = true;
alert('Support # '+recordId.Support_ID__c+' is currently being transferred to SAP, therefore you cannot do a Mass Change now.');
break;
}
}
}

if( flag == false){

//alert('Else');

window.open("/apex/AreaSupportMassChange?selectedRecords="+records);
}

 

Thanks in advance:)))