• Daniel Martins 4
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hi Guys,
I need to get the Name of the Territory to assign it to a field, but when I try it, it generates an error.

this is my code:

 List<UserTerritory> myList = [SELECT Id, UserId, TerritoryId 
                                      FROM UserTerritory 
                                      WHERE UserId = :UserInfo.getUserId()];
        
        Set<Id> territoryIds = new Set<Id>();
        for(UserTerritory terr : myList) {
         territoryIds.add(terr.TerritoryId);
        }
        
        List<Territory> territoryN = new List<Territory>([SELECT Id, Name
                                                             FROM Territory
                                                             WHERE Id = :territoryIds LIMIT 1]);

        System.debug('NAME TERRITORY******' + territoryN.Name);

in the System.Debug I need view the Name (territoryN.Name)  and the error is "Variable does not exist: Name"

Please help me 
When checking the challenge  I get a persisting issue with the "Phone Plan" external object 

Displayed message is : 
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.ExternalObjectException: data.api.DataSourceException: This data is no longer available. The "Phone_Plan" table in the external data source is currently unavailable. Try again later or contact your administrator for help.


I have tried with a new developer ORG and I get the same error.

Thanks. 
Hi Guys,
I need to get the Name of the Territory to assign it to a field, but when I try it, it generates an error.

this is my code:

 List<UserTerritory> myList = [SELECT Id, UserId, TerritoryId 
                                      FROM UserTerritory 
                                      WHERE UserId = :UserInfo.getUserId()];
        
        Set<Id> territoryIds = new Set<Id>();
        for(UserTerritory terr : myList) {
         territoryIds.add(terr.TerritoryId);
        }
        
        List<Territory> territoryN = new List<Territory>([SELECT Id, Name
                                                             FROM Territory
                                                             WHERE Id = :territoryIds LIMIT 1]);

        System.debug('NAME TERRITORY******' + territoryN.Name);

in the System.Debug I need view the Name (territoryN.Name)  and the error is "Variable does not exist: Name"

Please help me 
When checking the challenge  I get a persisting issue with the "Phone Plan" external object 

Displayed message is : 
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.ExternalObjectException: data.api.DataSourceException: This data is no longer available. The "Phone_Plan" table in the external data source is currently unavailable. Try again later or contact your administrator for help.


I have tried with a new developer ORG and I get the same error.

Thanks.