Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
I tried.. A.B__c = ''; update A; looks like this doesn't work.. It says invalid ID.. – user10930 Aug 22 '14 at 15:00
up vote 2 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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