0
votes

Like the title says, I am getting that error when I am trying to save a certain apex class. I am able to save other apex classes, just not this one.

Most of what I have seen says that this error is given by the database, and is related to DML statements or history tracking of fields on objects. My class does not have any SObjects in it. It is a generated class from a SOAP WSDL, so it never puts anything in the database at all. All sub-classes and fields it uses are declared within the class, so it shouldn't be dependent on any other apex class.

The only other thing I read is that it could have something to do with workspaces, so I tried creating a new workspace in the dev console, and switched back and forth between workspaces to see if it would save correctly then. It made no difference.

I have also tried saving the class from the dev console, as well as ForceCode, a plugin that lets you develop in VSCode. I get the same result from both environments.

I'm really stumped with this one. I'm wondering if there is something incompatible in the generated code, which really means going back and changing the SOAP service just so I can get the WSDl generated class to be different.

Btw, the class is generated using wsdl2apex through Eclipse's plugin, Force.com.

//Generated by wsdl2apex is at the top of the class.

1
Update: I was able to save the code as a new class with a different name, so it's definitely not the code itself that is the problem. Any SF guru's out there? I really, REALLY don't want to have to go back and replace every reference to the old class just because I can't save over it. - ncooper09

1 Answers

0
votes

I figured out what it was; it was totally my own fault.

The previous devs on the project had 2 classes that both represented this SOAP service. Neither were named well, and they were from different versions of the service, so I had created a 3rd and replaced all references of the previous 2 with my 3rd. When I went to edit my class, I (unthinkingly) was trying to edit the wrong file, and so the file was trying to save a duplicate class.

The error message was still really unhelpful, but the fault was entirely mine, not the environment.