I have two objects A and B. I have a look up reference of B on A. In certain cases, if the A has B reference, I would want to delete the look up it by making it null or blank, so that I can look up a new B reference on A.

How do I achieve this using soql query?

Thanks, P

  • I tried.. A.B__c = ''; update A; looks like this doesn't work.. It says invalid ID..
    – user10930
    Commented Aug 22, 2014 at 15:00

1 Answer 1


Based on your last comment, change

A.B__c = ''; 
update A;


A.B__c = null;
update A;

'' is an empty string, rather than a null value which is what you need to clear a lookup.

You must log in to answer this question.

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