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

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(,;
    insert coinfo;
 Record__c rec1= new Record__c(,;
    insert coinfo;
Record__c rec2= new Record__c(,;
    insert coinfo;   


string idlist','',';


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




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:-


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


For example:



Thanku !


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: 




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(','); 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. 



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"