I am trying to deploy some components through retreive-deploy fascility of Workbench and while deploying, the deployment of lightning controller class is failing with error:

SOQL TYPEOF expressions are not supported in this organization

I have used following query in the class which usees TYPEOF clause:

  TYPEOF SetupOwner
      WHEN Profile THEN Name
      WHEN User THEN Name               
  FROM MyCustomSetting__c

Do we need to unable something in target org to allow use of TYPEOF?

2 Answers 2


See this article SOQL TYPEOF expressions that contains this important information:

Currently, this feature is only available in sandbox environment, This feature is not available in production organization. Please contact Support to get this feature enabled in your sandbox organization if you would like to test it. Once this feature is generally available (GA), support will be able to enable this in production (paid) organizations too.

This means that you cannot use this feature in production right now and there is no definite date when you will be able to use it in production. So it's an "experiment only" feature.

  • But in my DE org , I can use it. And my target org is a DE org as well.
    – Sarang
    Feb 16, 2017 at 10:48
  • It doesn't mean you can't use it in production...it means you need support to enable it.
    – Adrian Larson
    Feb 16, 2017 at 10:51
  • @AdrianLarson So " Once this feature is generally available (GA)" doesn't apply?
    – Keith C
    Feb 16, 2017 at 14:01
  • Ah. Hmm...I guess I misread that. They might...
    – Adrian Larson
    Feb 16, 2017 at 14:04

TYPEOF will be Generally Available in the Summer 19 Release

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.