You need to sign in to do that
Don't have an account?

Looking for a workaround to perform DML operations on a Read-only visualforce page
Dear SF experts,
I have a visualforce page in read-only mode as the collection size in my controller exceeds the maximum size of 1,000.
However, on the same page I also need to save inputfields but DML operations are not allowed on a read-only page.
On save, the following error page is shown:
Visualforce ErrorHelp for this Page
System.LimitException: Too many DML statements: 1
Error is in expression '{!save}' in component <apex:commandButton>
Are there any workarounds to kill 2 birds with 1 stone? ie allow a collection size of more than 1000 records AND have the page perform DML operations.
I'm aware I could use pagination to query 1000 records iteratively but I would like to avoid this option as I need a search feature on the page which is only useful if ALL records are loaded at once.
Would I be able to save records if I used a popup window + javascript remoting while the parent window is read-only?
Any inputs would be much appreciated!
Regards,
I have a visualforce page in read-only mode as the collection size in my controller exceeds the maximum size of 1,000.
However, on the same page I also need to save inputfields but DML operations are not allowed on a read-only page.
On save, the following error page is shown:
Visualforce ErrorHelp for this Page
System.LimitException: Too many DML statements: 1
Error is in expression '{!save}' in component <apex:commandButton>
Are there any workarounds to kill 2 birds with 1 stone? ie allow a collection size of more than 1000 records AND have the page perform DML operations.
I'm aware I could use pagination to query 1000 records iteratively but I would like to avoid this option as I need a search feature on the page which is only useful if ALL records are loaded at once.
Would I be able to save records if I used a popup window + javascript remoting while the parent window is read-only?
Any inputs would be much appreciated!
Regards,
All Answers