A method on the "Label" system class is not recognised as a valid symbol

Issue #2363 duplicate
Jason van Beukering created an issue
  • The Label class supports a “get” method which allows one to get a translated value (or default value) for a label.
  • IC is doesn’t not detect this as a valid symbol and does not provide code completion or inline help etc.

Comments (8)

  1. Jason van Beukering reporter

    I also noticed the following is also considered invalid (basically the symbols on Network aren’t coming up like an SObject)

    • Network.Description.getDescribe().getLocalName();

  2. Scott Wells repo owner

    The Label method is not present because it’s newly-introduced in Summer '23. It will be included in the IC2 build that accommodates changes for that release, and in fact has already been implemented locally:

    Regarding the Network.* behavior, oddly I’m not even seeing Network in the Schema OST namespace folder. I’ll check why it’s not there…either it’s not being reported by the Salesforce API or IC2 is deciding not to include it, perhaps incorrectly seeing it as a duplicate of System.Network.

  3. Scott Wells repo owner

    I was being silly. The org must have the Communities feature and Digital Experiences (previously “Communities”) enabled. Then Network is properly available as an SObject type.

    Your example does raise an interesting bug, though. IC2 sees the following as incorrectly invalid:

    Network.Description.getDescribe().getLocalName();
    

    but the following as fine:

    Network.fields.Description.getDescribe().getLocalName();
    

    That’s easy enough to fix, though, and I’ll take care of it for one of the upcoming builds.

    UPDATE: Already fixed. IC2 has an existing special case provision for SObject type names that are also found in the implicit System namespace, e.g., BusinessHours, Location, and Site. I just needed to add Network to that special case list so that these types of resolutions happen properly for unqualified references to those names in compile-time SObject type/field constants.

  4. Scott Wells repo owner

    Merging into the Summer '23 update placeholder issue since the other aspects have been delivered and the remaining portions are part of that update.

  5. Log in to comment