2

I have created an APEX REST web service and tried to use StandardSetController in order to retrieve objects for some list view. My idea was to use this built in list view functionality for objects retrieving and don't implement the functionality for query building on my own. But when a method of the service simply creates StandardSetController and I run such method sending a REST request - I recieve the following error:

[{"message":"No Visualforce context has been established!","errorCode":"UNKNOWN_EXCEPTION"}]

Does it mean that there is no way to use StandardSetController outside of APEX Visualforce page? Or can noted "Visualforce context" be somehow established for the web service?

1

I've noticed some problems doing this recently, though I wasn't lucky enough to see that error surfaced (I got the old Salesforce.com Internal Error).

I created a case with Salesforce and they said it was because I was not using the StandardSetController in a Visualforce context (i.e. without a VF page). They did say it was a regression though and was submitted for bug fix.

  • Thanks for the reply! Phil, does it mean that SalesForce team is going a fix and using StandardSetController will be possible outside of Vistualforce context? – Vitaly Shlyaga Dec 24 '13 at 14:40
  • 1
    They said "Our app server logs indicates that the class 'StandardSetController' throws and Internal Server Error due to there not be a Visualforce context with its use in the Dev Console. However, the same code works in an org prior to Winter '14, I have raised an investigation to R&D asking if this is a regression" and the case status is "Bug Fix Submitted" though I don't know if it will every be possible I'm afraid (they gave no indication) – Phil Hawthorn Dec 24 '13 at 17:46
  • Ok, thanks. It sounds like there is no guarantee still that this will be fixed. – Vitaly Shlyaga Dec 25 '13 at 7:22
  • I wouldn't hold your breath – Phil Hawthorn Dec 25 '13 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.