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
nelle3223nelle3223 

Formula Problem with both fields a picklist

Hello,

I have a formula and cannot seem to figure out the problem.  I am wanting it to say: When the Stage (Picklist field) of the Opportunity equals Proposal in Development then Bid Defense Required field (Picklist field) needs to be updated.
Here is what i have so far:
AND(
ISPICKVAL(StageName, "Proposal in Development")),
ISPICKVAL( Bid_Defense_Required__c, "")
@Karanraj@Karanraj
Needs to be updated? You want to make that field as required(non-empty) or you want to set the value to that field?
RohRoh
Hello Nelle,
By what i see is that , you just added and AND condition , but no output is mentioned. 
And also, by using a formula field you cannot update another field. 
Take a look at this below,
https://developer.salesforce.com/page/An_Introduction_to_Formulas.

For your perfect use case, we should use a after insert , after update trigger on Opportunity record.
Another option would also be to use a Workflow field update, but that involves hardcoding to some value, which i would not encourage..

Trigger Solution :
trigger OpportunityTrigger on Opportunity (after insert,after update)
{
  if(trigger.new[0].StageName != null && trigger.new[0].StageName == 'Proposal in Development')
{
   trigger.new[0].Bid_Defense_Required__c = 'VALUE WHAT YOU WANT' ;
}
}

PLEASE SELECT THIS AS THE RIGHT ANSWER,IF YOU LIKE IT.

Thanks,
Rohit Alladi

 
nelle3223nelle3223
what i am trying to do if the Stage field is changed to Proposal In Development then we need an error stating that the Bid Defense Required field must be filled in.  Does that make sense?  I am trying to do a validation rule.
RohRoh
Hello Nelle,
Gotcha !!
In that case , the above should have worked ..else no problem try this way.

(ISPICKVAL(StageName, 'Proposal in Development')) &&
(ISPICKVAL( Bid_Defense_Required__c,''))

Try this out !!
Let me know , how it works.

Thanks,
Rohit Alladi
@Karanraj@Karanraj
Yes.. now it makes sense. Then you need write a validate rule in opportunity object, there is closing bracket issue in your validation rule formula.
Try this 
AND( 
ISPICKVAL(StageName, "Proposal/Price Quote"), 
ISPICKVAL( icode__DeliveryInstallationStatus__c, ""))

 
nelle3223nelle3223
thanks!  that is what i needed. You can close this.
RohRoh
Hello Nelle,
Can you please mark the answer as Resolved, it will help others as well.
Thanks in advance

Thanks,
Rohit Alladi