3

I have a scheduled class which scans through all of the records which have been made for a specific custom object and creates what is a "Monthly Report" record for that record (on a different object). It populates one of the fields in the new record with a name which appears in one of the fields of the original object. However, it is getting a "OP_WITH_INVALID_USER_TYPE_EXCEPTION" error when firing off.

I read this helpful post regarding the error :

https://developer.salesforce.com/forums?id=906F000000090bRIAQ

That seems to be a possibility for my problem. However, in my case the code is being fired off by a schedule, not a trigger. So, would I still be getting the same problem if I was creating new records by a schedule and populating a field with a Chatter Free user ? Granted, that person is indeed regarded as the "Owner" of the record and is the only name on the record, but I didn't know if Salesforce technically regarded the person as the "owner" if it was merely a name in a field.

Anybody have any ideas on this ?

2 Answers 2

3

Chatter-only users cannot be referenced in 'lookup' fields such as Owner.

There are 2 alternatives:

  1. create a text field and put the user's names in it instead of the Id's (not so nice, obviously)
  2. create an additional User lookup field (not Owner, since that is completely blocked by SF) and fill that with the userId. Note that this will not work in the GUI, only via apex. Basically you use the workaround described here: https://success.salesforce.com/ideaView?id=08730000000gAeIAAU#
0

In my case, I was playing with the user which is having a community license and that was causing the issue.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .