"Constructor not defined" error for SObject creation using constructor signature

Issue #1466 resolved
Eduard Salesforce created an issue

I am wondering, is SObject constructor signature supported in IC? When I create SObject using constructor signature IC marks it as error.

Comments (8)

  1. Scott Wells repo owner

    Yes, Illuminated Cloud understands SObject constructors with field initialization. The error message shown in that screenshot doesn't come from Illuminated Cloud. Is that returned from the API based on an attempt to deploy that class? If not, do you have some other plugin installed that's adding that error perhaps?

  2. Eduard Salesforce reporter

    Scott, thanks for your reply. No, this error appears right away when I open the file. I didn’t install any other plugins except Illuminated Cloud. Bundled plugins doesn’t count, and what is more, I turned off some of them.

  3. Eduard Salesforce reporter

    Yes, it is up-to-date. I noticed one thing, though. My project is SFDX, but I don’t use scratch org, and connect to a sandbox instead. Yesterday I had a problem with some sobjects - some fields were not recognized by IC (Cannot resolve symbol error) even though the fields were present in the Symbol Table. When hit “Go to declaration”, it sent me to this folder “.sfdx/tools/sobjects/customObjects” which is generated by SFDX, not IC. Then I opened VS Code and Refreshed SObject definitions. After that everything worked fine. Can it be that SFDX project has impact on IC and how it makes its checks?

  4. Scott Wells repo owner

    Ah, yes. Those items under .sfdx are put there by VS Code and can confuse IC because they technically represent the same overall concept but aren't well-formed SObjects. IC should prompt you to exclude that folder when present. If it does, just accept the prompt to do so. If it doesn't (and I'd like to know that because it would represent a bug), right-click on .sfdx/tools/sobjects and click Mark Directory as>Excluded. That will resolve this issue.

  5. Scott Wells repo owner

    If you find that IC isn't properly detecting and prompting to exclude .sfdx/tools/sobjects, please re-open this and let me know.

  6. Eduard Salesforce reporter

    .sfdx/tools/sobjects and click Mark Directory as>Excluded worked like a charm. Thank you Scott!

  7. Log in to comment