You need to sign in to do that
Don't have an account?

Formula is not working one part regex is working
Hi Can any one help me,
I have a text field in which i am trying to save alpha numeric and i am trying to limit the range between 0100 to 0555 so the values should save between the range and alpha numeric.i worte a formula like this.
AND(
NOT(REGEX(Text__c,"^[a-zA-Z0-9_]*$")),
OR(
VALUE(Text__c) < 0100,
VALUE(Text__c) > 0555 ) )
So here example am giving AC15 value in the field it is working.
if i give the value 0101 it is saving and if i give it as 1111 it is
also saving which is not correct.REGEX part is working but not the other part OR Part.
I have a text field in which i am trying to save alpha numeric and i am trying to limit the range between 0100 to 0555 so the values should save between the range and alpha numeric.i worte a formula like this.
AND(
NOT(REGEX(Text__c,"^[a-zA-Z0-9_]*$")),
OR(
VALUE(Text__c) < 0100,
VALUE(Text__c) > 0555 ) )
So here example am giving AC15 value in the field it is working.
if i give the value 0101 it is saving and if i give it as 1111 it is
also saving which is not correct.REGEX part is working but not the other part OR Part.
There is no value that doesn't work.
You cannot find a value that doesn't work.
All Answers
Always zero at the beginning.
0 - 100 - 499
0 - 500 - 549 - 555
if(rm.matches()) is better for a test here.
REGEX(Text__c,"^0([1-4][0-9][0-9]|5([0-4][0-9]|5[0-5]))$")
https://developer.salesforce.com/forums/?id=9060G0000005VNCQA2
There is no value that doesn't work.
You cannot find a value that doesn't work.
Open the Developer Console:
https://help.salesforce.com/articleView?id=code_dev_console_opening.htm&type=5 (https://help.salesforce.com/articleView?id=code_dev_console_opening.htm&type=5)