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
grahamecossegrahamecosse 

error - "This page has changed since you started your edit."

Hi,

 

I am getting the following error and am struggling to find a fix.

 

"This page has changed since you started your edit. Refresh your page and try again."

 

The code has been running fine on developer accounts on na6 and na7 but is now failing on cs2!  Turning on logging doesnt pick up anything.  I don't understand why it works fine on one instance but not the other... dont think there is anything in the config that is much different.  Refreshing does not help.

 

I think the error may happen during a redirect but I will have to go through the code  - just wondering if anyone has seen this one before?

 

Any thoughts?

 

Thanks

Graham

myredpointmyredpoint

I just started getting this on a page on NA7.  It was working fine last week.  I'm not doing a redirect.  It has something to do with pageMessage on mine because no data is changing and I have no inputfields on the page.

nathanael.mnathanael.m

I've started seeing this error as well. In my particular case it's when I perform an action on a page that happens to contain a custom component with it's own controller and form.

 

Also, it's only affecting components whose Salesforce.com API version is set to 19.0. If I change it back to 18.0 things work fine.

 

QingsongQingsong

Please do check if you reference the same controller extension in multiple pages, and you are trying to reference one page from another.

 

I had same issue today,  I was tried to send email with PDF attachment, I did created two pages, one for render PDF file, another for send email screen, those two pages are using same controller extension, from below send mail code, you will see, the controller extension have been refreshed because I want to render PDF as attachment, but the send mail screen still remain same - return null means does not redirect to any page, then i got the error message "This page has changed since you started your edit. Refresh your page and try again.".

 

the solution for me is split this into two controller extension, one for send mail screen, another for PDF attachment, then it is working fine.

 

hope this idea works for u.

 

	public pageReference send(){
		//Define the email
		Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
		
		
		ID QuotationId = ApexPages.currentPage().getParameters().get('id');		
		System.debug('Quote ID: ' + ApexPages.currentPage().getParameters().get('id'));
		
		
		
		//Reference the attachement page to pass in the quote ID
		PageReference pdf = new PageReference('/apex/QuotationPrintPDF?id='+ApexPages.currentPage().getParameters().get('id'));
		pdf.setRedirect(true);
		//take the pdf content
		Blob b = pdf.getContent();
		
		//Create the email attachment
		Messaging.EmailFileAttachment efa= new Messaging.EmailFileAttachment();
		efa.setFileName('xxxx.pdf');
		efa.setBody(b);
		
		List<String> toAddress = new List<String>();
		toAddress.add('qingsong.li@msn.com');
		email.setSubject('Email quote ');
		email.setToAddresses(toAddress);
		email.setHtmlBody('xxxx');
		email.setFileAttachments(new Messaging.Emailfileattachment[]{efa});
		
		//Sends the email
		Messaging.Sendemailresult[] r = Messaging.sendEmail(new Messaging.Singleemailmessage[] {email});
		return null;
	}
    

 

trsmithtrsmith

I think this is an API version mismatch issue. I was getting exactly the same error. Then I noticed that my site template was API version 19 while all of my pages were version 18. Changing everything to version 19 resolved the issue for me.