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
Coral RacingCoral Racing 

Formula Help with AND(OR() Statement

Hello

I have a formula as below to check a field as true within a workflow if any of the following criteria are met

(AND(
Emergency_RFC_to__c = TRUE
||
AND(
BMCServiceDesk__State__c = TRUE, BMCServiceDesk__Status__c = 'SUBMITTED FOR CAB'
)
||
AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Failed'), ISBLANK(Post_Implementation_Comments__c))
||
AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Rolled back'), ISBLANK(Post_Implementation_Comments__c))
||
AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Withdrawn'), ISBLANK(Post_Implementation_Comments__c))
||
AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Completed with Outage Caused'), ISBLANK(Post_Implementation_Comments__c))

))


However, it doesn't seem to work.  Is there something I have missed?

Thanks

Sonya
Arunkumar RArunkumar R
Could you try the below formula,
 
(OR(Emergency_RFC_to__c = TRUE ,

AND(BMCServiceDesk__State__c = TRUE, BMCServiceDesk__Status__c = 'SUBMITTED FOR CAB'),

AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Failed'), ISBLANK(Post_Implementation_Comments__c)),

AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Rolled back'), ISBLANK(Post_Implementation_Comments__c)),

AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Withdrawn'), ISBLANK(Post_Implementation_Comments__c)),

AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Completed with Outage Caused'), ISBLANK(Post_Implementation_Comments__c))

)
)

 
Coral RacingCoral Racing
Hi Thanks for the help, unfortunately this doesn’t update the field to be true either.
Arunkumar RArunkumar R
Hi Coral,

Try to monitor debug log and ensure the crieria are met. The formula is right condition.
Coral RacingCoral Racing
Thanks – How do I do that?
Arunkumar RArunkumar R
Take a look on the below link,

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log.htm
Sanjay Mulagada 11Sanjay Mulagada 11
To debug - go to setup > Logs > Debug Logs
Step 1: Create a log under your name.
Step 2: Update your record to meet your workflow criteria to fire again.
Step 3: Now go to your debug log and search for your workflow name(Ctrl+F) and see what it says next to the workflow either True or False

  If True workflow fired and if False workflow didnt fire you could understand at that point what seems to be failing. Hope this helps !
Carlos Campillo GallegoCarlos Campillo Gallego
Hi Sonya,

Just for curiosity... are you trying to make True Emergency_RFC_to__c field?
If that's the case, you have to use the formula that Arunkumar (with a little change) posted and make a field update action and associate it to the workflow.
This would be the formula edited:
OR(
	AND(BMCServiceDesk__State__c = TRUE, BMCServiceDesk__Status__c = 'SUBMITTED FOR CAB'),
	AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Failed'), ISBLANK(Post_Implementation_Comments__c)),
	AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Rolled back'), ISBLANK(Post_Implementation_Comments__c)),
	AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Withdrawn'), ISBLANK(Post_Implementation_Comments__c)),
	AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c , 'Completed with Outage Caused'), ISBLANK(Post_Implementation_Comments__c))
)
Note that the workflow itself does not change anything, you have to associate the action you want to perform to it.

Hope this helps you :)

Kind regards,

Carlos.
 
Coral RacingCoral Racing
Hi Thanks for your reply. Emergency_RFC_to__c = TRUE is a custom field that is checked and unchecked using another workflow. Thanks Sonya
Carlos Campillo GallegoCarlos Campillo Gallego
Hi again :)

There must be something we are missing, have you checked that the picklist values in the formula are exactly as in the picklist field? this is case sensitive and it would not be the first time I face that problem...
Post_Implementation_Comments__c is a text field or a lookup? if it's a lookup you should try ISNULL instead ISBLANK

Kind regards,

Carlos.