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
EvanetEvanet 

Field Validation - Can't seem to get this working correctly

Hi,

I want to enforce that two fields are required based on the value of a picklist.

I have it working fine for one field but when I add the second field to the validation formula it makes no difference at all.

Here is the formula.I am using

AND( ISPICKVAL( Service_Type__c , "Ported") , LEN( Existing_Provider__c ) =0, LEN( Existing_Account_Number__c )=0 )

Using this will only enforce the required attribute be applied to the field "Existing_Provider_c". I can still save the record even if I have the field "Existing_Account_Number__c" empty.

Both fields are text so I hope I have assumed correctly that the LEN function is the correct way to go for both.

The AND function should only return true if ALL the conditions are met. In this case they are not met but the validation process seems to regard it as true.

Appreciate any thoughts where I may be going wrong.

Cheers

Mal
wgrwgr
Hi Mal,

You may use the following formula:

AND( ISPICKVAL( Service_Type__c , "Ported") , OR(LEN( Existing_Provider__c ) =0, LEN( Existing_Account_Number__c )=0 ))

This formula enforces "Existing Provider" and "Existing Account Number" to be filled out as soon as "Ported" is selected in the field "Service Type"

Cheers

Werner

Message Edited by wgr on 06-07-2007 11:05 PM