Skip to main content
Added Query solution
Source Link
crmprogdev
  • 41k
  • 9
  • 58
  • 116

Adam's post led me to the true cause of the problem which also merits posting a separate answer.

Database.insert(nwAssnmnt, false); was allowing errors in the OwnerID Field to occur while still inserting the records. In my investigations, I discovered that the OwnerIDs I was trying to pass were actually contact ID's. Inserting the records with invalid OwnerID records was apparently creating all the other problems I was experiencing.(sigh)

I'd have expected this to have been a fatal error since it's an important required field, but apparently that wasn't the case; so it's something I'll be watching for in the future!

I forgot to add, once the above problem was fixed, Related_Activity_Event__c IN :RAELS also fixed the query problem. :)

Adam's post led me to the true cause of the problem which also merits posting a separate answer.

Database.insert(nwAssnmnt, false); was allowing errors in the OwnerID Field to occur while still inserting the records. In my investigations, I discovered that the OwnerIDs I was trying to pass were actually contact ID's. Inserting the records with invalid OwnerID records was apparently creating all the other problems I was experiencing.(sigh)

I'd have expected this to have been a fatal error since it's an important required field, but apparently that wasn't the case; so it's something I'll be watching for in the future!

Adam's post led me to the true cause of the problem which also merits posting a separate answer.

Database.insert(nwAssnmnt, false); was allowing errors in the OwnerID Field to occur while still inserting the records. In my investigations, I discovered that the OwnerIDs I was trying to pass were actually contact ID's. Inserting the records with invalid OwnerID records was apparently creating all the other problems I was experiencing.(sigh)

I'd have expected this to have been a fatal error since it's an important required field, but apparently that wasn't the case; so it's something I'll be watching for in the future!

I forgot to add, once the above problem was fixed, Related_Activity_Event__c IN :RAELS also fixed the query problem. :)

Source Link
crmprogdev
  • 41k
  • 9
  • 58
  • 116

Adam's post led me to the true cause of the problem which also merits posting a separate answer.

Database.insert(nwAssnmnt, false); was allowing errors in the OwnerID Field to occur while still inserting the records. In my investigations, I discovered that the OwnerIDs I was trying to pass were actually contact ID's. Inserting the records with invalid OwnerID records was apparently creating all the other problems I was experiencing.(sigh)

I'd have expected this to have been a fatal error since it's an important required field, but apparently that wasn't the case; so it's something I'll be watching for in the future!