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
Giancarlo AmatiGiancarlo Amati 

No Visualforce context has been established

Dear All,

after refreshing our full sandbox we noticed the following issue. We are using CPQ to create quotes. We have a button called "Preview Document". This brings us to a page where we can select the template. 

When we select any of the template, and press "Preview" we see the following error message:

core.apexpages.exceptions.ApexPagesGenericException: No Visualforce context has been established!

User-added imageI've never seen that error message before. Where can I look at?
Thank you.
GC
VinayVinay (Salesforce Developers) 
Hi Giancarlo,

I believe this is a result of your Quote Template containing template content that points to custom sources using an incorrect URL.  URL is likely a production URL and will have to be adjusted to match your current instance. This will have to be done for all content that is using an incorrect URL.

Thanks,
Vinay Kumar
Giancarlo AmatiGiancarlo Amati

Hi Vinay,
thank you. I have a question tho. The issue started once I've refreshed the FULL sandbox. If those URL exists in the production and don't in the FULL sandbox, does that mean that the refresh doesn't take those and replicate them in the sandbox?
Thank you,

GC

VinayVinay (Salesforce Developers) 
Hi Giancarlo,

No,  I mean to say to need to update custom sources urls with existing sandbox instance.

Eg.  When you refresh your sandbox the existing URL which is production will copy so replacing with current sandbox instance should fix the issue.

Sample urls:

Sandbox: https://domain-sandboxname-my.salesforce.com

Production: https://domain.my.salesforce.com

Thanks,
Vinay Kumar