Inspector false alarm on SObjectField EmailTemplate.fieldName

Issue #2307 resolved
Eric Kintzer created an issue

Easy to reproduce (anonymous apex)

SObjectField fld = EmailTemplate.DeveloperName;  // this is valid and compiles fine

generates spurious inspector message Partner API queries can not use Tooling SObjectTypes.

You can work around the inspector warning by coding:

SObjectField fld = Schema.EmailTemplate.DeveloperName;

Comments (7)

  1. Scott Wells repo owner

    Eric, I’m not seeing that:

    and Tooling API SObjects should never be used for resolution except in standalone SOQL queries. Obviously that’s not holding here, though, as you’re seeing this issue. Are you seeing this in all of your projects or just specific ones?

  2. Eric Kintzer reporter

    Scott

    It appears in just this project. I looked to see if there were any classes named EmailTemplate and there are not, including in managed packages.

    Highlighting EmailTemplate and going to its definition - IC2 takes me to the SObject EmailTemplate which is correct. What else would you like me to provide for diagnostics?

    Eric

  3. Scott Wells repo owner

    Okay, so you’re not able to reproduce this in a standalone project? What if you copy this project to another directory and strip it down to bare-bones? Does it still reproduce? If so, could you put that project somewhere so I can access it?

  4. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  5. Log in to comment