+ Start a Discussion
sfdc dev 2264sfdc dev 2264 

credit card number validation

Hi,

I have a requirement which i need help

1) i have a email-to-case where once a case gets created in salesforce i need to verify if there is any credit number present and if so i need to make a custom checkbox on case to true based on it i need to show a pop up message on lightning action saying that this case is having credit card number

i tried using workflow regex function but if i enter any number like 012 its making the checkbox to true automatically, please let me know how can i achieve it in salesforce

Thanks in advance
Raj VakatiRaj Vakati
You have an exact solution here 

https://developer.salesforce.com/forums/?id=9060G000000MVKVQA4
Raj VakatiRaj Vakati
http://regexlib.com/REDetails.aspx?regexp_id=49&AspxAutoDetectCookieSupport=1
sfdc dev 2264sfdc dev 2264
I have written the workflow field update like below

AND( 
(Credit_card_number_validation__c) = FALSE, 
(NOT(REGEX( Description , "^((4\\d{3})|(5[1-5]\\d{2})|(6011))-?\\d{4}-?\\d{4}-?\\d{4}|3[4,7]\\d{13}$" )) 

)

but it its working for all even if i have number like 012  in my case description which is not a valid  credit card number how will i make sure that the checkbox field is checked only for a valid credit card number and not for any random number like phone number or date

 
bankcredit bankcreditbankcredit bankcredit
Go to the login region and read through the data. You need an interesting on the web ID and secret phrase to sign in. In a tough situation in Publix login you would need to remain signed in. publix oasis my schedule You can reset your secret phrase by heading off to the overlooked secret phrase interface.