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
Pablo ArgentinaPablo Argentina 

Complex Validation?

Hy guys.

I'm new in this and trying to do something complex for me, but sure is not for you.

 

I have 3 fields.

UserType: is a picklist with 4 different values

IMEI__c: Numeric values up to 15 digits

IMEI_a_confirmar__c: Checkbox

 

The idea is the following.

If UserType = "NUMBER1" OR "NUMBER2"

IF IMEI_a_confirmar__c is NOT checked

Then IMEI___c should HAVE exactlly 15 digits

 

 

I did created the rule that IMEI___c have to have 15 digits: IF(LEN(TEXT( IMEI__c ))<> 15, TRUE, FALSE)

But the other validations, don't know where to add them (or how).

 

 

Any idea?

Thanks in advance!!!

Pablo

shra1_devshra1_dev

Hi Pablo,

 

Try out this

 

 

IF(AND(OR(ISPICKVAL(UserType,'NUMBER1'),ISPICKVAL(UserType,'NUMBER2')),IMEI_a_confirmar__c = false),

IF(LEN(TEXT( IMEI__c ))<> 15, TRUE, FALSE),FALSE)

 

give reply if u hav any issues...(because i am not 100% sure)

 

Regards,

 

Shravan

Pablo ArgentinaPablo Argentina

Shara1_Dev, thanks for your answer.

Unfortunatelly is not working because UserType is not a field, is a page format selection.

I have a new idea, maybe easier.

 

What about the following:

 

If IMEI___c is not blank, then check if IMEI__c lenght is equal to 15

 

Haha, this should work... but i'm so lost with this APEX coding....

I SHOULD START A TRAINING!!!

 

thanks again.

Pablo