Salesforce Validation Formula - validation

I've been stuck on this for a couple of days and can't seem to get it to work.
I'm trying to have an error fire when someone saves an opportunity:
Multi-Select - Call Qualifying
Checkbox - only 1 checkbox of the following can be checked
Here's the code I have so far. There are no syntax errors
AND (
INCLUDES(Metric__c,"Call Qualifying"),
OR( Call_Tagging_Client__c ,Call_Tagging_Est__c ,!Call_Tagging_Service__c
) ,
OR( Call_Tagging_Client__c,!Call_Tagging_Est__c ,Call_Tagging__Service__c
) ,
OR( !Call_Tagging_Client__c,Call_Tagging_Est__c ,Call_Tagging_Service__c )
))

if you haven't already resolved this, here is a pointer: The problem in your original formula is that you are using three OR functions when you actually want AND since, for each set of three fields, you want exactly one to be checked.
Try this instead:
AND(
INCLUDES(Metric__c, "Call Qualifying"),
OR(
/* Any of the next three conditions, each for exactly one checkbox checked */
AND(Call_Tagging_Client__c, !Call_Tagging_Est__c, !Call_Tagging_Service__c),
AND(!Call_Tagging_Client__c, Call_Tagging_Est__c, !Call_Tagging__Service__c),
AND(!Call_Tagging_Client__c, !Call_Tagging_Est__c, Call_Tagging_Service__c)
)
)

Related

I have to write validation rule on custom object customer as

If city__c is equal to hyd panCard, phone,email blank through error.
i don't know if i understood your question correctly. Try it with:
AND(
city__c = 'hyd panCard',
ISBLANK(phone),
ISBLANK(email)
)

Salesforce Opportunity Validation Rule

I am working on a validation rule on the Opportunity object. The goal is to bypass a validation rule if an item from a Multi-Select picklist is selected, otherwise the code should fire
Here's what I have so far - everything works except the exception portion - NOT(CONTAINS('Campaign_Tactic__c','Call Monitoring')))
So the validation rule should fire unless the Call Monitoring multi-select is chosen.
The Validation Rule should prevent an Opportunity Save if:
Opportunity Record Type = True
Opportunity Stage = Closed Won or Proposal Request
Landing Page Setup Field = blank/no data
Campaign Tactic Multi-Select field = does not contain the Call Monitoring Option
AND (
RecordType.DeveloperName = "New_Opportunity",
OR (
ISPICKVAL(StageName, "Closed Won"),
ISPICKVAL(StageName, "Proposal Request")
),
AND (
ISBLANK(TEXT(Landing_Page_Setup__c))
),
(!CONTAINS('Campaign_Tactic__c','Call Monitoring'))
)
From the Salesforce Formula Function Reference, it's important to note
The CONTAINS function does not support multi-select picklists. Use INCLUDES to see if a multi-select picklist has a specific value.
Additionally, the first argument you're providing to CONTAINS() is a quoted string literal, not a field reference, and the outer parentheses are extraneous:
(!CONTAINS('Campaign_Tactic__c','Call Monitoring'))
Your final clause should use INCLUDES(), as:
!INCLUDES(Campaign_Tactic__c, 'Call Monitoring')
Note also that AND() with a single argument can be replaced by the argument alone, so
AND (
ISBLANK(TEXT(Landing_Page_Setup__c))
),
reduces to
ISBLANK(TEXT(Landing_Page_Setup__c)),
You need the TEXT() call only if that field is a picklist.

Check a date field is blank or empty in MS Flow expression

As part of an email step in our Flow, we are creating an HTML table, where certain rows are hidden using css.
So our expression formula (in the body of the Outlook - Send an email from a Shared Mailbox step looks like this:
if(
And(
Or(
equals(triggerBody()['DD_Artwork']['Value'], 'Bargain New Store')
, equals(triggerBody()['DD_Artwork']['Value'], 'Home & Fashion')
,equals(triggerBody()['DD_Artwork']['Value'], 'Home Store'))
, #empty(triggerBody()?['StoreOpeningDate']))
,'tr.StoreOpenDate {display:visible}', 'tr.StoreOpenDate {display:none}')
this part, checking the Date Selector field StoreOpeningDate is not working:
, #empty(triggerBody()?['StoreOpeningDate']))
we have also tried:
, Not IsBlank(triggerBody()?['StoreOpeningDate']))
and
, Not IsEmpty(triggerBody()?['StoreOpeningDate']))
and even:
, Not equals(triggerBody()?['StoreOpeningDate']), '')
but we always get the error message The expression is invalid
so what's the right way to go about this?
I faced a similar problem. The TriggerBody() function is doing the damage. Just use
Empty(item()?['DateField']) not equal to false in the condition.

Matlab:figure error

I'm having a problem with set function in MatLab gui I'm getting this error :
Invalid handle object.
there is my code:
[value index] = min( CostFunction(params, ...
input_layer_size, ...
hidden_layer_size, ...
num_labels, ...
X, y, lambda));
set(handles.cfwoText,????,value);
Value returned from [value index]is type double ex:1.4563e-011,and I want to show it on EditText called cfwoText,but i dont know what type should I write in ?
I believe a simple google search will provide an answer.
In addition, in GUIDE you can write click your Edit Text and choose Property Inspector. You will see all the properties.
Having said that, what you are looking for is
set(handles.cfwoText,'String',num2str(value));
Note that num2str is required since value is double and the text is string.

Get a value from a parent Block

I'm facing some difficult to accomplish this apparently easy task.
I'm in a nested block ( suggestion.phtml ) and I want to get a value ( number of search result, and so the collection count) from a parent block ( result.phtml )
I'm wrong or there is not an easy way here ?
Ok solved.
It is possible to access a parent block with:
$this->getParentBlock();
So in this particular scenario:
$searchCount = $this->getParentBlock()
->getParentBlock()
->getParentBlock()
->getResultCount();

Resources