• amaga
  • NEWBIE
  • 5 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Hi All,

 

I'm seeing some strange behavior in my test methods.  To summarize, I insert a test user and a test object.  The test object has a custom lookup to user.  I assign the test user to that custom lookup. 

 

When I first insert the user I debug its isActive flag and it shows true.  But when I execute my test method and debug its isActive flag in the class I'm testing it shows as false and causes my tests to fail.  I recently added this check for customUserLookup.isActive and that's when the tests started breaking.  

 

Has anyone else run into this issue?

 

Thanks for your help.

 

  • September 13, 2012
  • Like
  • 0

Error: Failure Message: "System.DmlException: Insert failed. First exception on row 407; first error: INACTIVE_OWNER_OR_USER, operation performed with inactive user: []", 

 

Hi all,

 

We have a really weird situation. Sounds like this may be a Salesforce bug that was introduced recently. What we had working perfectly before (last 2 months), is failing as of this evening.

 

Background: 

Created a change set in production this morning. Validated successfully. When trying to deploy the change set this evening, we get:

Failure Message: "System.DmlException: Insert failed. First exception on row 407; first error: INACTIVE_OWNER_OR_USER, operation performed with inactive user: []", 

 

The line of code that is throwing the error is a inserting a custom object. The owner of the custom object may be an inactive user.  From everything I have read, that is allowed.

 

Also, this used to run just fine before and the exact same code is throwing the exception.

 

This is only happening when the code is called from a Test Method (v24). 

 

Any ideas what could the cause? Has something changed around how Salesforce enforces inactive users?

 

Thanks,

Geek62

Hi Board,

I'm facing a issue in trigger where in i'm trying to perform a dml statement using List<sObject>.

It throws exception for me when i have more then 900 records in my list.

Error message is stated below:

System.TypeException: Cannot have more than 10 chunks in a single operation. Please rearrange the data to reduce chunking.

 

I'm having a hard time writing a test method for a custom object that has Formula Fields on them that are being used in the methods I am trying to cover.

 

When I debug the fields in the test method they are coming up as null, but, if I query the record it shows those fields as being updated correctly.

 

Where I run into a problem is when I have nested formula fields and then pass the final record I want tested to the method via a trigger.  The field that starts at the top level of the hierarchy hasn't made it all of the way to the final record.

 

Is there something I'm missing or do I need to query each and every object before associating it to the next in the hierarchy?  The final record doesn't have a direct reference to the fields in question but the class queries them based on a set criteria.

 

Any help would be appreciated.  Thanks!