Skip to main content
Post Undeleted by sfdcfox
Right Answer, Wrong Question. Edited to be the answer I intended for this question.
Source Link
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828

Your text editor madeBecause of the wrong apostrophessheer number of tables involved, resultingyou can't use the SetupEntity relationship; in code that failed to compilethis way, it behaves more like a "special text field" rather than a "lookup relationship" field.

// This will not compile
System.debug(‘I am static method’);
// This one is okay
System.debug('I am static method');

Make sure you're The documentation does not specifically call this out, but if you check the examples, you'll notice there's no example of using Microsoft Word or some other "smart" editor to write your codethe SetupEntityId field as a relationship. If copy-pasting,You'd need to make sure the apostrophes are not "smart quotesseparate queries for each name that you need, which may mean querying hundreds of times (so, you might need to do it in chunks, depending on complexity)."

Your text editor made the wrong apostrophes, resulting in code that failed to compile.

// This will not compile
System.debug(‘I am static method’);
// This one is okay
System.debug('I am static method');

Make sure you're not using Microsoft Word or some other "smart" editor to write your code. If copy-pasting, make sure the apostrophes are not "smart quotes."

Because of the sheer number of tables involved, you can't use the SetupEntity relationship; in this way, it behaves more like a "special text field" rather than a "lookup relationship" field. The documentation does not specifically call this out, but if you check the examples, you'll notice there's no example of using the SetupEntityId field as a relationship. You'd need to make separate queries for each name that you need, which may mean querying hundreds of times (so, you might need to do it in chunks, depending on complexity).

Post Deleted by sfdcfox
Source Link
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828

Your text editor made the wrong apostrophes, resulting in code that failed to compile.

// This will not compile
System.debug(‘I am static method’);
// This one is okay
System.debug('I am static method');

Make sure you're not using Microsoft Word or some other "smart" editor to write your code. If copy-pasting, make sure the apostrophes are not "smart quotes."