Skip to main content
added 38 characters in body; edited tags; edited title
Source Link
Adrian Larson
  • 151.4k
  • 38
  • 247
  • 431

Location SObject How to reference in APEXconflicted SObject Name?

It seems that there are two differents Locationdifferent Location objects:

  • global class Location extends SObjectglobal class Location extends SObject
  • global class System.Locationglobal class System.Location

Because System is the default namespace, I canam not sure how to refer to the SObject Location in APEXmy Apex code.

Example (in Location trigger):

Map<Id, Location> newLocations = (Map<Id, Location>) Trigger.newMap;

--> Incompatible types since an instance of Map<Id,SObject> is never an instance of Map<Id,System.Location>

Incompatible types since an instance of Map<Id,SObject> is never an instance of Map<Id,System.Location>

Is there any way for me to get those SObjectreference the Location SObject?

Location SObject reference in APEX

It seems that there are two differents Location objects:

  • global class Location extends SObject
  • global class System.Location

Because System is the default namespace, I can not refer to the SObject Location in APEX.

Example (in Location trigger):

Map<Id, Location> newLocations = (Map<Id, Location>) Trigger.newMap;

--> Incompatible types since an instance of Map<Id,SObject> is never an instance of Map<Id,System.Location>

Is there any way for me to get those SObject ?

How to reference conflicted SObject Name?

It seems that there are two different Location objects:

  • global class Location extends SObject
  • global class System.Location

Because System is the default namespace, I am not sure how to refer to the SObject Location in my Apex code.

Example (in Location trigger):

Map<Id, Location> newLocations = (Map<Id, Location>) Trigger.newMap;

Incompatible types since an instance of Map<Id,SObject> is never an instance of Map<Id,System.Location>

Is there any way for me to reference the Location SObject?

Source Link
Simonp
  • 1.9k
  • 4
  • 25
  • 50

Location SObject reference in APEX

It seems that there are two differents Location objects:

  • global class Location extends SObject
  • global class System.Location

Because System is the default namespace, I can not refer to the SObject Location in APEX.

Example (in Location trigger):

Map<Id, Location> newLocations = (Map<Id, Location>) Trigger.newMap;

--> Incompatible types since an instance of Map<Id,SObject> is never an instance of Map<Id,System.Location>

Is there any way for me to get those SObject ?