MyCustomObject__Share not found when editing code - If Historical Trending is enabled for a field
Issue #1831
resolved
Win10 Enterprise 20H2 running both
-
IntelliJ IDEA (build #IC-203.7148.57, 25 Jan 2021 21:24)
-
WebStorm 2020.3.1 Build #WS-203.6682.155
I have a problem with the IDE recognizing MyInnocentObject__Share objects for just 1 of my custom objects. I believe I tracked this down to a root cause of the MyInnocentObject has a field called Devil_Field which has Historical Trending enabled on it.
Steps:
- Create Custom Object MyInnocentObject
- Enable sharing for MyInnocentObject
- Add field "Devil_Field" to MyInnocentObject
- In Salesforce, Naviate to Setup -> Analytics -> Reports & Dashboards -> Historical Trending
- Enable Historical Trending for Devil_Field
- In IntelliJ, create a retrieve a project with MyInnocentObject
- Recreate the OST
- Create an Apex Class/Method with anything that references MyInnocentObject__Share - "MyInnocentObject__Share myObj;" is enough
-
Confirm Error
- Expected: IDE does not complain about the line. eg no red squiggly lines, etc.
- Actual: IDE does not recognize MyInnocentObject__Share and thus shows you the red squigglies.
-
Look at OST zip file. Confirm that MyInnocentObject__Share.cls exists
- Notice the zip also contains /MyInnocentObject/c_hd.cls
- Delete /MyInnocentObject from OST zip (Just the directory, not the class files in the root)
- In IntelliJ, File -> Invalidate Caches and restart
- Open test class and notice MyInnocentObject__Share is recognized and the squigglies are gone
Comments (2)
-
repo owner -
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
Thanks for filing, Eric, and especially for the detailed steps to reproduce. I'm right in the middle of a significant change right now but will queue this up for investigation after I wrap up that work. I'll keep you posted as I try to reproduce it myself.