You need to sign in to do that
Don't have an account?
Carter85
Need Help resolving a "Cyclical server-side forwards detected" error
I'm trying to take a VF page I've created and which the user is currently viewing, convert it to a pdf on an actionbutton click and save it to an Object record, but everything I try returns the error I referenced in the subject of this thread.
My current method is this:
My current method is this:
public pageReference savePdf(){ System.Pagereference currentPage = ApexPages.currentPage(); Attachment attach = new Attachment(); Blob body = currentPage.getContentAsPDF(); attach.Body = body; attach.Name = 'RemitRegister.pdf'; attach.ParentId = 'a0319000000ppIf'; insert attach; PageReference newPg = new PageReference('/apex/CM_MonthlyRemittance'); newPg.setRedirect(true); return newPg; }From what I've seen in similar instances when people have come across this it's generally caused when you try and return the same page which is currently being displayed. However, even with any number of means of trying to redirect or return a different page this still occurs for me and is getting quite frustrating as this is the only nagging issue which is preventing the larger project from being completed. Any help would be appreciated.
As I said, any suggestion/solution would be great so I can hopefully finish this.