You need to sign in to do that
Don't have an account?
Jason Reiber [ACS]
IDE Execute Anonymous is Inserting records for real
I'm wondering if maybe I'm doing something wrong with the IDE. I executed some anonymous code in the IDE which included insert statements, then later I noticed in the tenant that the data was actually inserted into the DB and left there. When the same code was executed via the Developer Console, this did not happen. Is there some setting in the IDE or some extra thing I need to do to avoid this? Fortunately it hasn't caused any real problems other than a little data clean up and now I can't use the Execute Anonymous feature in the IDE. Here is the code I was executing :
It was creating both the Certificatin Type and Administration custom object records and not deleting them after the code was finished executing them. Any thoughts?
Administration__c admin = new Administration__c(); insert admin; System.debug('>>>>> admin id = ' + admin.id); Certification_Type__c certType = new Certification_Type__c(Active__c=true, Administration__c=admin.id); insert certType; System.debug('>>>>> cert type id = ' + certType.id);
It was creating both the Certificatin Type and Administration custom object records and not deleting them after the code was finished executing them. Any thoughts?
There is no straightforward settings for what you are trying to achieve, but you may achieve this by some code,
1. Throw some arbitraty Exception at last line of your code, i.e.
2. Create a Savepoint before your code and rollback after all operations, i.e.
--Akram
All Answers
There is no straightforward settings for what you are trying to achieve, but you may achieve this by some code,
1. Throw some arbitraty Exception at last line of your code, i.e.
2. Create a Savepoint before your code and rollback after all operations, i.e.
--Akram
Thanks for responding, for some reason I had the idea in my head that the Execute Anonymous feature was similar to a test class where the data was not committed to the DB. I'll have to double check the Developer Console and see if it is in fact committing the inserts.