Custom Objects with a Name identical to Standard Objects do not have their Change Event SObjects indexed

Issue #1928 resolved
Christian Gottlieb created an issue

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)

  1. Scott Wells repo owner

    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 and Contract. Should be easy enough to try to reproduce. I'll let you know what I find.

  2. Scott Wells 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:

    1. Created a new empty project.
    2. Created a new scratch org for that project.
    3. 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
    4. Logged into the org and created a Contract__c custom object.
    5. Regenerated the OST which now includes the following classes for the Contract* types (notice that there are both ContractChangeEvent and Contract__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
    6. Added Contract__c to my project's metadata subscription.
    7. Retrieved the metadata for Contract__c into the local project.
    8. Regenerated the OST which looks exactly the same as it did after the previous iteration.
    9. Added Contract to my project's metadata subscription.
    10. Retrieved the metadata for Contract into the local project.
    11. 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?

  3. Scott Wells 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.

  4. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  5. Log in to comment