5

As part of a POC, someone had created a big object called StatusTracking__b. After a few stuff-ups they ended up keeping StatusTracking3__b in the system.

The time has come for things to get refactored and I thought I'd go back and use a proper API name for this object, so I tried to deploy a new metadata definition for StatusTracking__b. The platform complained with:

objects/StatusTracking__b.object -- Error: That object name is already in use.

I have gone through all things - metadata API, enterprise WSDL, describes, SOQL queries and I can assure you that this object does not exists - at least form my perspective.

Schema.getGlobalDescribe().get('StatusTracking__b').getDescribe();

System.NullPointerException: Attempt to de-reference a null object

To confirm this I created a brand new big object Boris__b and also created a bunch of records. Then I deleted this object (and erased it). Second time around I was able to deploy the metadata definition using the same API name Boris__b without any issues.

Is this an intermittent bug with big objects or is there something that I could be missing? Where else could the object name be used, without the actual definition (object doesn't exist)?

2
  • The object name isn’t being used by a regular old Custom Object, Platform Event, Custom Metadata etc is it? Commented Mar 10, 2018 at 12:56
  • That's the first thing I checked - went through all metadata. No references... Commented Mar 12, 2018 at 9:13

1 Answer 1

2

Apparently, this works as expected. Salesforce support came back with an answer that the prefix of the object name (the API name before the __) must be unique across any object types (custom, big, platform events etc.).

To verify this I tried creating a big object and a platform even that had the same prefix as one of my other custom objects, and I got the same error.

Lesson learned the hard way - keep your object names unique across all different types.

3
  • So exactly what I suggested? What had you burned the object name on in the end? Commented Mar 17, 2018 at 23:42
  • Well I would've thought you can have the same API name for different types of sObjects... It would've been good to have the same object name with __c and __b for an example so that you don't have to define mappings etc. rather just replace c with b in your code :) I'll have to go with a different pattern Commented Mar 21, 2018 at 2:59
  • 1
    This has bitten me when trying to convert some custom settings to custom metadata. I thought exactly the same as you at the time. Commented Mar 21, 2018 at 22:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .