Question: I have following code which I am trying to execute in Console but failing with error below. 

CODE: 

```
Implementation__C I = New Implementation__C();
I =[select Account__c,ID, Name from Implementation__C where ID = 'Record ID'];
I.Account__c = 'Account record ID';
update I;

```

ERROR: 

> 
> Line: 4, Column: 1  
> 
>  System.DmlException: Update failed. First exception on row 0 with id a0j0V00000NaBYgQAN; first error: INVALID\_CROSS\_REFERENCE\_KEY, invalid cross reference id: []
> 
> 
>

Answer: 
Can you run this code at your console

```
Account acct = [SELECT Id, Name FROM Account WHERE Id='Account record ID'];
Implementation__C Impl = [select Account__c,ID, Name from Implementation__C where ID = 'Record ID'];
Impl.Account__c = acct.Id;
update Impl;

```
for what it's worth, no need to query anything to perform an update

```
update new Implementation__c(Id = 'record id', Account__c = 'account id');

```