I was working on a new class in the DC, then had to go into the Salesforce org and configure some things, during which time the "resume" prompt popped up in the DC. I selected to resume, and continued editing the class.

But when I attempted to save the changes, this error dialog popped up (and keeps popping up)

INVALID_ID_FIELD Unable to patch container member.: invalid record id

So I closed the class and when I reopened it, all the code except for the class declaration was gone.

(Thankfully I copied/pasted my work into Notepad++ before closing.)

Any ideas what caused this, and how to prevent it? Thanks.

1 Answer 1


Under the hood there seems to be an ongoing ping to cometd. My guess, it's for logging, monitoring and breakpoints. If you stay passive for some time, this ongoing ajax calls will be suspended and you get that timeout, together with a possible loss of data. This mechanism seems "by design" and I guess there isn't much you can do about - except of save your work more often.

In my experience for bigger projects and longer files the DC isn't exactly the productivity boost.

You might consider alternatives:

  • Force.com IDE
  • Sublime with Mavensmate
  • elastify CodeFusion
  • Danke sehr, Uwe. I did try the Force.com IDE within Eclipse, and encountered strange caching issues. Example, synchronising code to server did not update code on Salesforce, and also running tests within Eclipse seemed to execute older copies of code. What do you use, out of curiousity?
    – Alexx
    Commented Feb 20, 2015 at 16:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .