You need to sign in to do that
Don't have an account?
Fernand
associate RecordSetVar with Save command
I created a visualforce page with a simple save action and it just works fine.
However when I added recordSetVar, the save/quicksave actions don't seems to work anymore.
can you please point out what did I miss?
However when I added recordSetVar, the save/quicksave actions don't seems to work anymore.
<apex:page standardController="Account" recordSetVar="accounts"> <apex:form > <apex:pageBlock > <apex:pageMessages /> <apex:pageBlockSection > <apex:inputField value="{!account.name}"/> <apex:commandButton action="{!QUICKSAVE}" value="SAVE!"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
can you please point out what did I miss?
When you create a visual force page with simple save action method it works fine, the reason is you are operating on only one recrord and save action method will save only one record at a time.
When you add "recordsetvar" what will happen is it will store set of records pertaining to that particular variable which you have defined for recordsetvar, so when it is storing multiple records in that variable(collection of records) and you are trying to save them at one shot it does'nt work.More or less recordsetvar is used to store multiple records and display them accordingly.It(recordsetvar) does'nt have anything to do with save and quicksave
Purpose of recordsetvar
For example, if your page is using the standard accounts controller, and recordSetVar is set to "accounts", you could create a simple pageBlockTable of account records by doing the following:
<apex:page standardController="Account" recordSetVar="accounts">
<apex:dataList var="a" value="{!accounts}" type="1">
{!a.name}
</apex:dataList>
</apex:page>
Above displays all account with number.
As we make use of recordset var it helps in storing all the account records in "accounts" variable and by using the datalist component we are just displaying them accordingly in the vf page.But when you use save and quicksave methods simultaneously when recordsetvar is in use it does'nt work and redirects back you to the home page.
Please let me know if it helps you..............
Thanks & Regards,
Nagendra.P
9848950830
All Answers
Thanks,
Nitin Sharma
It is still not working with the action save when using recordsetvar. Please let me know the issue.
nope, both save or quicksave command doesn't work.
When you create a visual force page with simple save action method it works fine, the reason is you are operating on only one recrord and save action method will save only one record at a time.
When you add "recordsetvar" what will happen is it will store set of records pertaining to that particular variable which you have defined for recordsetvar, so when it is storing multiple records in that variable(collection of records) and you are trying to save them at one shot it does'nt work.More or less recordsetvar is used to store multiple records and display them accordingly.It(recordsetvar) does'nt have anything to do with save and quicksave
Purpose of recordsetvar
For example, if your page is using the standard accounts controller, and recordSetVar is set to "accounts", you could create a simple pageBlockTable of account records by doing the following:
<apex:page standardController="Account" recordSetVar="accounts">
<apex:dataList var="a" value="{!accounts}" type="1">
{!a.name}
</apex:dataList>
</apex:page>
Above displays all account with number.
As we make use of recordset var it helps in storing all the account records in "accounts" variable and by using the datalist component we are just displaying them accordingly in the vf page.But when you use save and quicksave methods simultaneously when recordsetvar is in use it does'nt work and redirects back you to the home page.
Please let me know if it helps you..............
Thanks & Regards,
Nagendra.P
9848950830
I think your answer explains it.
I was just confused while studying this documentation:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_sosc_actions.htm
Thank You!
Sounds really good if it helped you.................
Best Regards,
Nagendra!