I'm getting a strange error when trying to run some unit tests. I know the trigger works fine when used outside the unit tests. When running the unit tests, I create some sample data, and when I try to insert it, I get this exception:
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, <trigger name>: execution of AfterInsert caused by: System.NullPointerException: Argument 1 cannot be null External entry point: 
I've looked on here, and I know string.valueOf() can throw this if the value is null, but it's not even reaching my code before it throws this, and I'm not using any valueOf() calls in the triger. It's not giving me an line number in the trigger that's causing the problem. Can any give me an idea of why this is happening? This unit test has been stable for months, and now all of the sudden it's failing.
I have no custom validation on this object.
I'm not sure if this is even possible, but I thought I would try:
I've got a large system that I'm working on. Each page in this system requires a large amount of data to be pulled and orginized before they can be used (this data is unique to each user and is critical to the functionality).
The way I have it working currently is each page load calles a static method that setups up all this data in the constructor for each page (there are about a dozen custom pages that use this). This makes the entire system slow because each page change/reload requires the data to be reprocessed.
What I would like to do if at all possible, is to hang on to this processed data between page changes. I know this cannot be done by keeping it in the memory, but is there any way that I can store most or all of the data someplace so that I can recall it without having to perform the data processing all over again?
I've run into a kind of wall. Here's what I need to do:
I have to do near daily deployments to a org. The org requires that batch jobs be running. I cannot deploy when these jobs are running. Typically, what I do is delete and recreate the jobs after the deployment, but this is an issue as the jobs can change from day to day as I'm not creating them (the users are), so I cannot just write a script once to restart and leave it at that.
What I would like to do is write a script that would take all the currently running jobs, and write the restart scripts for those jobs and then stop the old jobs. I know how to get the old jobs, the cron expressions, and how to restart them, the issue I'm having is I cannot figure out how to get the class/report/dashboard that the job is running for. I know the cronTrigger object is very restriceted, but I was wondering if anyone knows how to do this, if it's even possible.
I'm trying to retrieve a couple of Apex Classes (already in v31.0).
This is the exception I get:
com.sforce.ws.ConnectionException: Unexpected element. Parser was expecting element 'http://soap.sforce.com/2006/04/metadata:done' but found 'http://soap.sforce.com/2006/04/metadata:fileProperties' at com.sforce.ws.bind.TypeMapper.verifyTag(TypeMapper.java:389) at com.sforce.ws.bind.TypeMapper.verifyElement(TypeMapper.java:418) at com.sforce.soap.metadata.RetrieveResult.loadFields(RetrieveResult.java:237) at com.sforce.soap.metadata.RetrieveResult.load(RetrieveResult.java:230) at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:631) at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:507) at com.sforce.soap.metadata.CheckRetrieveStatusResponse_element.loadFields(CheckRetrieveStatusResponse_element.java:62) at com.sforce.soap.metadata.CheckRetrieveStatusResponse_element.load(CheckRetrieveStatusResponse_element.java:54) at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:631) at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:507) at com.sforce.ws.transport.SoapConnection.bind(SoapConnection.java:174) at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:148) at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99) at com.sforce.soap.metadata.MetadataConnection.checkRetrieveStatus(MetadataConnection.java:229) at com.force.deploy.tools.MainUIController.processApex(MainUIController.java:683)