You need to sign in to do that
Don't have an account?
BMill
How do I blank out a look-up field?
I'm quite new to Visualforce and hoping for some advice. I want to blank out the "Primary Campaign Source" field on our opportunities page. Initially my thought was to run a field update and blank out that field upon creation, but it is not available to update through workflow.
How do I blank out this field, only upon creation of the opportunity, using Visualforce or APEX?
Thanks in advance,
Brook
I am assuming by "blank out" you mean clear the current value (what would be passed in from a lead for example).
You could use an Opportunity Trigger for this. Make it a before insert, this will only fire on insert (creation) of the new record.
Fairly trivial, I believe it would look something like this (untested):
trigger clearPCS on Opportunity(before insert){ for(Opportunity o:Trigger.new){ o.Campaign=Null; } }