function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eddie DeveauEddie Deveau 

FIELD_INTEGRITY_EXCEPTION: Account ID: id value of incorrect type

I am trying to create a new record on a separate object (new contract on Contract object from Proposal object). And I am receiving this error FIELD_INTEGRITY_EXCEPTION: Account ID: id value of incorrect type. 
Not sure how to diagnose this one. 
debradebra
What method are you using to create the new record?  APEX, Flow, other?
Eddie DeveauEddie Deveau
I am using a flow. 
debradebra
Within the flow make sure you have queried a field where the Account ID is stored and saved to a variable then use the variable to assign the value to the record you are creating.
Eddie DeveauEddie Deveau
Thank you for the response and yes, done that. Currently storing the AccountId to recordId.  It may also be useful to note that I have also created a record choice set of contact names where the user should be able to choose contacts related to the account. However no contacts are showing up when I run the flow. This is just on the initial screen, so it seems there's a disconnect with the account even before the flow runs. 
Eddie DeveauEddie Deveau
Thank you for the response, and yes I've done that. Storing the AccountId to the variable recordId. It may be useful to note that I've created a record choice set on the initial screen where the user should be able to select contacts associated with the account however no contacts are appearing on this screen. So it appears I'm having some disconnect with the account before the flow runs.
Eddie DeveauEddie Deveau
Ok , so my question is more basic then. When I just put in the accountId (copy and paste), the flow runs fine. I'm having issues with actually getting that Id to show up in the first place. This flow starts on the Proposal object which looksup to the Account, then it creates a new record on the Contract object which also looksup to the account... soo somehow its just not referencing the accountId? Or I need to have that query occur before the screen element?
debradebra
Eddie – if you do not pass in the actual account ID when calling the flow then Yes you need to do record lookup/query to get the account ID and save the query result into a variable sObject is a good choice.
Eddie DeveauEddie Deveau
So I have a Get Records element that is getting the AccountId from the Account object and storing it into recordId... however the Id being stored is still the same Id on the proposal and not on the actual Id on the Account. This element is before the rest of the flow starts as well. Somehow I'm still not appropriately lookingup the actual account Id