Incorrect type detection for EventBus.ChangeEventHeader
Issue #1818
resolved
See the image below for example
Comments (4)
-
repo owner -
repo owner Good news. I can concretely isolate these fields and give them the correct data type at OST generation time. The other fields which are documented as being of type "complexvalue" (and which are reported as such by the API) should in fact be of type
Object
at runtime. I've just committed a fix for this for inclusion in the next non-Spring '21 build, likely next Thursday. -
reporter That’s great news, thanks for looking into this so fast :)
-
repo owner - changed status to resolved
Delivered in 2.1.6.1. Note that you'll need to regenerate your OST after updating for these changes to take effect.
- Log in to comment
Thanks for filing. The issue is that Salesforce reports that field as being of type
Object
because it's considered a "complexvalue" as documented here:https://developer.salesforce.com/docs/atlas.en-us.sfFieldRef.meta/sfFieldRef/salesforce_field_reference_CaseChangeEvent.htm
It looks like there are a number of other system SObject fields that are similarly expressed as "complexvalue". I'll see if I can assess a concrete data type for these fields safely and update the offline symbol table generator to do so. If not, I'll update the illegal assignment inspection to ignore these particular fields so that you don't get this type of false positive. If I have to go that route, things like extract refactorings won't infer the proper type, but you won't see these types of errors.