You need to sign in to do that
Don't have an account?
Hari@Rockzs
How to pass multiple recordids in query string parameter
Hai,
Can u any one help me to pass selected record id as query string parameters
ThanX
SFDC bluefish
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hai,
Can u any one help me to pass selected record id as query string parameters
ThanX
SFDC bluefish
This is not a particularly functional example, but it does demonstrate the idea behind the concept of view state passing.
All Answers
Can you please elaborate or post a code snippet? Apex? Visualforce? API?
Apex Code does not fare well with multiple parameters with the same name (the normal HTML form specifications). A normal web developer would expect the query to be /apex/MyCustomPage?id=Record1&id=Record2&id=Record3. In order to make life less awkward, most languages require the developer to do extra work to make this happen. PHP, for example, requires "[]" to be added to the form's field name. There is no such documented way in Apex Code to do this, so your best option is to do something like this: /apex/MyCustomPage?id=Record1,Record2,Record3. Once your controller has grabbed the parameter, you can use String.split to get the values into an array. As to how to generate this list, the path you take will be largely dependent on your method. I presume you'll be using JavaScript, so array.join is a quick and easy way to accomplish this goal.
You can use Pagereference class to set the parameter as query string and get the parameters as well.
Example:
ApexPages.currentPage().getParameters().put('id','your_id'); // set the parameter's value
String idParam = ApexPages.currentPage().getParameters().get('id'); // get the parameter's value
ApexPages.currentPages() returns the reference of currentpage (Pagereference type), and getParameters() method of pagereference class returns the map of parameters and their respective values.
Thanks for reply to all,
Scenario is,
I have Datatable containing two columns , one is checkbox ,second column is AccountName
like [] India
[] USA
[] Srilanka
now i want to select any of them,then selected records ids are passed to next VF page and selected account names are display in that VFPAGE.
If you're going between VF pages, you can use the same controller and extensions to automatically pass the data between the pages without the need for URL parameters.
Hai,
Thanks for reply
Can u provide any example code snippet.
SfdcBluefish
This is not a particularly functional example, but it does demonstrate the idea behind the concept of view state passing.
Thank u sfdcFox
For sharing u r knowledge with us, I have another issue please help me regarding this,
Scenario:-
Generic trigger for all objects. trigger will work on all objects in organization,while doing operations with objects.
Thanx IN Advance
You can't write just one trigger to hook onto every single sObject. You'd have to write one for each and every object you want to process.