I want to set up a process to assign a task to an opportunity field of type Lookup(User). When I try to trigger the process I get the following error:

"This record couldn't be saved because it failed to trigger a flow(...)"

And an email with further details:

RECORD CREATE: myRule_4_A1<br>
Create one Task record where:<br>
ActivityDate = {!myVariable_current.Survey_Scheduled__c} (May 17, 2016)<br>
OwnerId = {!myVariable_current.Prelim_OA__c} (003o000000WSdhWAAT)<br>
Priority = Normal<br>
Status = Open<br>
Subject = Generate Proposal<br>
WhatId = {!myVariable_current.Id} (006o0000009grQ1AAI)<br>
Failed to create record.<br>
Error Occurred: INSERT --- INSERT FAILED --- ERRORS : (FIELD_INTEGRITY_EXCEPTION) Assigned To ID: id value of incorrect type: 003o000000WSdhWAAT,<br>

It looks like the Prelim_OA field is of the wrong data type, but I've tried Lookup(User) and Lookup(Contact), neither works. Another thing I noticed is that other processes that assign tasks, the Assigned To strings take you to the user page when pasted at the end of salesforce.com and the prelim_OA value takes you to a contact page. Not sure if this is significant.

What data type would be needed to make this work?


OwnerId field takes user record id values. What you are assigning here is a contact i think. this probably is causing the issue. You can assign contact record id to the task field whoid and user record id to the task field ownerid.

  • So if I go to Setup > Build > Customize > Opportunities > Fields, create a new field, where would I find user record ID? I see Lookup(User), but not Lookup(User record ID). – Jezza May 25 '16 at 17:50
  • Actually i wasn't saying to create a new field. But rather assign the user's record-id to the field owner id. You can find the user's record id from the url , when you view the user record. So in your flow the current value {!myVariable_current.Prelim_OA__c}, i assume Prelim_OA__c is a lookup to contact. You need to have a similar field which has user's id to whom the task has to be assigned. Or get the task owner's (user record id) id dynamically in the flow. – SF Ninja May 25 '16 at 18:33
  • Ok. Then Prelim_OA needs to be a lookup(user) and not lookup(contact). A contact's id cannot be assigned to the Task OwnerId field. It only accepts User record id's. – SF Ninja May 25 '16 at 18:40
  • Thanks for the help, but as I mentioned in the original question, I've tried Lookup(User) and Lookup(Contact), each generated similar errors. – Jezza May 25 '16 at 18:44
  • No problem. Can you post the error which you get when you try with lookup(user). My assumption is - it should work without an issue. But there could be a different reason why you are getting the error. – SF Ninja May 25 '16 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.