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
Sourav PSourav P 

Complex formula Validation

Dear All,
Can anyone plz suggest , where i went wrong in creating the below formula, as per me formula is correct, and its working on some values, but not working on others. I couldn't ablle to identify where exactly i went wrong. thnx for your support.

Formula Creation Criteria :

User-added image

The formula i created for this ,
 
AND( 
NOT(ISBLANK(Thai_Identification_Number__c)), 
VALUE(RIGHT(Thai_Identification_Number__c,1)) <> 
( 
11- 
( 
IF( 
MOD( 
ROUND( 
( 
VALUE(MID( Thai_Identification_Number__c ,1,1))*13 + 
VALUE(MID( Thai_Identification_Number__c ,2,1))*12 + 
VALUE(MID( Thai_Identification_Number__c ,3,1))*11 + 
VALUE(MID( Thai_Identification_Number__c ,4,1))*10 + 
VALUE(MID( Thai_Identification_Number__c ,5,1))*9 + 
VALUE(MID( Thai_Identification_Number__c ,6,1))*8 + 
VALUE(MID( Thai_Identification_Number__c ,7,1))*7 + 
VALUE(MID( Thai_Identification_Number__c ,8,1))*6 + 
VALUE(MID( Thai_Identification_Number__c ,9,1))*5 + 
VALUE(MID( Thai_Identification_Number__c ,10,1))*4 + 
VALUE(MID( Thai_Identification_Number__c ,11,1))*3 + 
VALUE(MID( Thai_Identification_Number__c ,12,1))*2 
) /11,1 )*10,10 
)=0, 
10, 
MOD( 
ROUND( 
( 
VALUE(MID( Thai_Identification_Number__c ,1,1))*13 + 
VALUE(MID( Thai_Identification_Number__c ,2,1))*12 + 
VALUE(MID( Thai_Identification_Number__c ,3,1))*11 + 
VALUE(MID( Thai_Identification_Number__c ,4,1))*10 + 
VALUE(MID( Thai_Identification_Number__c ,5,1))*9 + 
VALUE(MID( Thai_Identification_Number__c ,6,1))*8 + 
VALUE(MID( Thai_Identification_Number__c ,7,1))*7 + 
VALUE(MID( Thai_Identification_Number__c ,8,1))*6 + 
VALUE(MID( Thai_Identification_Number__c ,9,1))*5 + 
VALUE(MID( Thai_Identification_Number__c ,10,1))*4 + 
VALUE(MID( Thai_Identification_Number__c ,11,1))*3 + 
VALUE(MID( Thai_Identification_Number__c ,12,1))*2 
) /11,1 )*10,10 
) 
) 
) 
) 
)
While its working for some values, I ont know why its not working for the value mentioned in my screenshot " 1488708326392"
User-added image
 
FearNoneFearNone
sourav,

there is nothing wrong with your formula based on "1488708326392".
the problem is not there...
you have to show the rest of the formual and provide the screenshot of Thai_Identification_Number__c-field.
Sourav PSourav P
Hello, Thanks. I have actually put here the entire formula , that i have set :). As well extreme below is the screenshot of the field where its not taking teh value. May i know plz if you want somthing more to know.
FearNoneFearNone
hi sourav,

your AND-formula will return false and I can't connect the formula's result to the Thai Identification Number.
Sourav PSourav P
Hello, I tool AND because, i want that whenever the field is not empty, then will it will evaluate the validation. I have another field resident , if that is " Thai" then only user need to input the value here. else, they can leave it blank. Thanks.