function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ezhil_kezhil_k 

What does it mean?

hi all.

Might be a silly question.. what does that idlist contains? all the records rec,rec1,rec2?

 

Record__c rec= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;
 Record__c rec1= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;
Record__c rec2= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;   

 

string idlist =rec.id+','+rec1.id+','+rec2.id;

 

ApexPages.currentPage().getParameters().put('recordid', idlist);

hitesh90hitesh90

Hi,

 

Idlist contains of combination of unique Id of That three records(rec, rec1, rec2)  which you have inserted.

 

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
My Blog:- http://mrjavascript.blogspot.in/

wt35wt35

It contains a list of the IDs of the 3 records separated by a comma.

 

For example:

5003000000R2uGA,5003000000R2dse,5003000000R2fOa

ezhil_kezhil_k

Thanku !

Peter_sfdcPeter_sfdc

idlist is a comma delimited String. It is not a list. 

 

The person who wrote this code is going to the trouble to do this because they are intending to pass many ID values over the URL in a manner that is acceptable to HTTP. HTTP does not support a List type construct, so they are serializing these into a string and assigning that comma delimited string to a url parameter. This would mean that the following would be appended onto the URL: 

 

?recordid=a01000000000001,a01000000000001,a01000000000001

 

On the receiving end of this request, you could then use a string split method call either in Javascript or in Apex to unmarshal this back into a list and work the the passed values. 

 

String stringOfIds = ApexPages.currentPage().getParameters().get('recordid');
List<Id> actualIdList = stringOfIds.split(',');
...do something with my list now...

In the context of Visualforce, this  may or may not be a safe way to approach the process of passing ids between two pages. If they share a controller, you can use the ViewState to encode these URLs and pass them securely in the HTTPS body, instead of the unencrypted URL portion of the request. 

 

sandeep@Salesforcesandeep@Salesforce

it means that you are inserting three records and then after it you are concatinating ids of these three records and passing in to URL for one parameter "recordid"