Custom Objects with a Name identical to Standard Objects do not have their Change Event SObjects indexed
If a Custom Object's Change Event is referenced in Apex, the editor will sometimes not recognize it and it’s data structure.
This is only the case if the Name without the __c is identical to a Standard object it seems. See attached screenshot. The class can be successfully deployed and Offline Table is up to date. In this case we have a Custom Object Contract__c
Comments (4)
-
repo owner -
repo owner Well, it was easy to try to reproduce, but I haven't been able to reproduce it so far. Here's what I've done:
- Created a new empty project.
- Created a new scratch org for that project.
- Generated the OST for that org/project which includes the following classes for the
Contract*
types:- Contract.cls
- ContractChangeEvent.cls
- ContractContactRole.cls
- ContractFeed.cls
- ContractHistory.cls
- ContractLineItem.cls
- ContractLineItemChangeEvent.cls
- ContractLineItemHistory.cls
- ContractStatus.cls
- Logged into the org and created a
Contract__c
custom object. - Regenerated the OST which now includes the following classes for the
Contract*
types (notice that there are bothContractChangeEvent
andContract__ChangeEvent
variant objects):- Contract.cls
- Contract__c.cls
- Contract__ChangeEvent.cls
- Contract__Share.cls
- ContractChangeEvent.cls
- ContractContactRole.cls
- ContractFeed.cls
- ContractHistory.cls
- ContractLineItem.cls
- ContractLineItemChangeEvent.cls
- ContractLineItemHistory.cls
- ContractStatus.cls
- Added
Contract__c
to my project's metadata subscription. - Retrieved the metadata for
Contract__c
into the local project. - Regenerated the OST which looks exactly the same as it did after the previous iteration.
- Added
Contract
to my project's metadata subscription. - Retrieved the metadata for
Contract
into the local project. - Regenerated the OST which looks exactly the same as it did after the previous two iterations.
Is your project perhaps metadata format and not source format? I haven't tried the steps above yet in a metadata format project, though I will shortly just for completeness' sake. Anything else notably different?
-
repo owner I just went through the same exercise in a metadata format project and with the same results. Sounds like either there's something materially different in what I'm doing in my attempts to reproduce this issue, or there's something more subtle going on and we'll need debug logs to get to the bottom of it.
-
repo owner - changed status to resolved
Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.
- Log in to comment
Hmmmm...okay, I'll take a look. IC2 does perform some checks during OST generation for local objects, but I wouldn't think it would confuse
Contract__c
andContract
. Should be easy enough to try to reproduce. I'll let you know what I find.