+ Start a Discussion
DeptonDepton 

checkbox = true then 2 picklist must filled in??

Hi 

 

I am trying this

 

AND( 
(Interesado_en_demo_online__c = TRUE), 
NOT(
ISBLANK(
ISPICKVAL(Purchasing_Authority__c ),
ISPICKVAL(Total_of_Employees__c ))))

 

Interesado is a checkbox that when is checked must make the 2 picklist fields mandatories?

 

got the : Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 1

 

Any ideas?

Thank you

Best Answer chosen by Admin (Salesforce Developers) 
SteveMo__cSteveMo__c

Here you go:

AND( 
Interesado_en_demo_online__c, 
AND(
ISBLANK(TEXT(Purchasing_Authority__c)),
ISBLANK(TEXT(Total_of_Employees__c ))))

also you don't have to write:    

"Interesado_en_demo_online__c = TRUE" when you're evaluating if a Checkbox field is checked, all you need is the API Name of the field.  

 

Interesado_en_demo_online__c = "Interesado_en_demo_online__c = TRUE"

NOT( Interesado_en_demo_online__c)  = Interesado_en_demo_online__c = FALSE

All Answers

SteveMo__cSteveMo__c

Here you go:

AND( 
Interesado_en_demo_online__c, 
AND(
ISBLANK(TEXT(Purchasing_Authority__c)),
ISBLANK(TEXT(Total_of_Employees__c ))))

also you don't have to write:    

"Interesado_en_demo_online__c = TRUE" when you're evaluating if a Checkbox field is checked, all you need is the API Name of the field.  

 

Interesado_en_demo_online__c = "Interesado_en_demo_online__c = TRUE"

NOT( Interesado_en_demo_online__c)  = Interesado_en_demo_online__c = FALSE

This was selected as the best answer
DeptonDepton

Gracias my friend!!!!!!

 

:))))

SteveMo__cSteveMo__c

Where's my cerveza???  

DeptonDepton

Here in Barcelona waiting for u my friend!! ;)

SteveMo__cSteveMo__c

The next time I visit Madeira PT, I'll have to make a side trip!

DeptonDepton

you see...that would be perfect!! I do have family in Portugal so might tell one of my cousins to invite you!!

 

:))

 

SteveMo__cSteveMo__c

The island or mainland?

DeptonDepton

Mainland, but I do have more than 30 relatves over there!! my mum is portuguese....but you must come to Barcelona! 

 

:))

 

If not next time (send me a private) tell me the beer you want  and I will buy it and send it via Internet!! 

 

:))

 

 

Whitney Klein 10Whitney Klein 10
Hi Steve, I am trying to do something similar for a trigger. I want to make it fire only when a checkbox is checked on the task. Here's the code I have so far and the field name is Quick_Call_Log__c. Thanks for any help!! 


trigger TaskTrgWithCheckbox on Task( after insert, after update ) 
{
    Map<Id, Account> accountsToBeUpdated = new Map<Id, Account>();
    
    for( Task t : trigger.new )
    {
        if(trigger.isInsert
            || ( trigger.isUpdate
                && ( trigger.oldMap.get( t.Id ).Call_Date__c != t.Call_Date__c
                    || trigger.oldMap.get( t.Id ).Description__c != t.Description__c )
                )
            )
        {
            if( t.WhatId != null && String.valueOf( t.WhatId ).startsWith( '001' ))
            {
                Account acc = new Account( Id = t.WhatId );
                acc.Last_Call_Date__c = t.Call_Date__c;
                acc.Last_Call_Description__c = t.Description__c;
                
                accountsToBeUpdated.put( acc.Id, acc );
            }
        }
    }
    
    if( accountsToBeUpdated.values().size() > 0 )
        update accountsToBeUpdated.values();
}