You need to sign in to do that
Don't have an account?

"Unable to perform save on all files..." always shows up
Hi,
I wrote some apex codes . It runs well in the developer environment,but when I deploy it into the production environment , the error message "Unable to perform save on all files: NumberFormatException: For input string" always shows up.
I write the codes with Force.com IDE.
Here is a sample:
Code:
public class CreateAccount { public static void verifyDealer(Account a){ //if(UserInfo.getProfileId()=='00e20000000lJU1AAM') { a.addError('access denied'); //} } static testMethod void test_verifyDealer(){ Account a = new Account(Name='test'); CreateAccount.verifyDealer(a); } }
Any help would be appreciated!
Thanks & Regards,
Kevin
If you have appropriate code coverage and no other errors in the code, it should activate. Currently, there is no way to activate production Triggers through the Salesforce interface like you can in a development org.
Message Edited by jpizzala on 04-11-2008 05:39 PM
here is a sample:
The codes' test coverage in Eclipse is 66% And in the active org is 75% .. why?
Message Edited by unikevin on 04-13-2008 08:31 PM
The record 00e20000000lJU1AAM exists only in your dev or production org, but it is highly unlikely that it is in both. Since you have 75% coverage in production and less in development, I would assume that the dev org does not have this record. Thus the IF statement will always be false in dev, reducing the coverage percentage.
Obviously this takes some working around when you are ready to deploy to production - you will have to change the SFID to reflect an existing record in the org you are trying to deploying to.
This probably won't solve your production trigger activation issue, but it may allow an underlying error to shine through.
It sounds like the code you posted is exactly as it is in your production org. Have you performed Run All Tests? This will give you an idea as to what is truly being covered by your Apex Classes and what is not. Since your trouble trigger is not activated, it won't show up on the Run All Tests report, but it may provide the coverage necessary for you to activate the trigger.
If this doesn't help, have you tried deploying with the Ant build tool? Sometimes Ant will provide you with errors that the IDE does not.
When you run the test in your sandbox, what lines show up as not being tested?
My guess is that your coverage doesn't include the addError line. The best way I've found to test error messages is to use try/catches in unit tests:
There might be a better way, but I haven't figured it out yet. addError always seems to cause a DmlException when Inserting/Updating from code.