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
DebbievdnDebbievdn 

Formula query

Hi there experts, I'm looking for a solution to the following:
I have two fields, one Next Step MEC (picklist field) and the other Next Step Date (date field). What I'm looking for is that when a change is made to the picklist value, the date must be updated too. This is not happening now.
Can anyone provide me with a formula to make sure that this happens?

Here's my current formula on the Date

AND(
NOT(ISPICKVAL(Next_Step_MEC__c, "")),
ISNULL( Next_Step_Date__c ),
RecordTypeId="xxxxxx")

I also have the following validation rules set:
Next_Step_Date If Next Step MEC contains a picklist value then Next Step Date must be entered
Stages_for_Next_Step_MEC Next Step MEC is required when stage is different from Closed Lost/Closed Won

Thanks!
Best Answer chosen by Debbievdn
John Pipkin 14John Pipkin 14
forgot a comma, sorry about that:
AND(
ISCHANGED( Next_Step_MEC__c),
!ISCHANGED( Next_Step_Date__c),
RecordTypeId = 'xxxxxx'
)

 

All Answers

Ashish DevAshish Dev
Just change to 
ISCHANGED( Next_Step_MEC__c)  && RecordTypeId = 'xxxxxx'

and it should work.
John Pipkin 14John Pipkin 14
Debbievdn,

You need to include the validation for ISCHANGED() for the date field as well. Like so:
AND(
ISCHANGED( Next_Step_MEC__c),
!ISCHANGED( Next_Step_Date__c)
RecordTypeId = 'xxxxxx'
)

Hope that helps!
John Pipkin 14John Pipkin 14
forgot a comma, sorry about that:
AND(
ISCHANGED( Next_Step_MEC__c),
!ISCHANGED( Next_Step_Date__c),
RecordTypeId = 'xxxxxx'
)

 
This was selected as the best answer
DebbievdnDebbievdn
Thans John, Very helpfull and attent of you.
regards debbie
DebbievdnDebbievdn
John, While your on a role, may I ask something else? We have created a section in our Opportunity Page layout. When the Opportunity is Closed Won, then the the following should be completed. My problem is that this may apply to all or only certain certain Sales Areas such as CE,EE,IT, etc.
MEC Internal Project Numbers 
PO Number from Customer
I was able to apply to this all areas, but
if I only require e.g. CE region, what type of formula would I need? (or indeed CE and IT and EE)?

Hope you can help, its not urgent, but would be nice...
Reagrds,
Debbie
John Pipkin 14John Pipkin 14
When you mention "Sales Areas" are you speaking about the territory management assignments?
DebbievdnDebbievdn
John, we have regional managers RSM'swho are responsible for their particular Sales Area e.g Central Europe (CE) etc. And under them Area sales managers who deal with THE Opps.
John Pipkin 14John Pipkin 14
Well, you would need to be able to access what the opportunity region is somewhere on the Opportunity, Account, or User. Such as, if the opportunity owner determines the region, then you can access that user's information using "Owner.FIELD_NAME_OF_REGION". So, assuming "Field_A__c" is one of the required fields and the region is stored on the user's record on "Field_B__c", it would look like this:
 
AND(
ISCHANGED(StageName),
IsWon,
ISBLANK(Field_A__c),
Owner.Field_B__c = "CE"
)

Without knowing more about where you are storing information, that's the best I can give. Hope that helps!