You need to sign in to do that
Don't have an account?
Dee Dee Aaron
Validation Rule: Must have at least 6 digits after the decimal point.
Hi there,
I’m looking to create a validation rule on a Geolocation field (longitude and latitude fields).
I want to ensure that the Sales reps are entering values that have a MINIMUM of 6 digits after the decimal place. How would I do this? I was thinking of creating a validation rule. But I’m not sure how to create the logic.
For example:
11.123456 (acceptable)
11.12345 (not acceptable)
Field Name: Coordinates __c
Thank you for your help!
I’m looking to create a validation rule on a Geolocation field (longitude and latitude fields).
I want to ensure that the Sales reps are entering values that have a MINIMUM of 6 digits after the decimal place. How would I do this? I was thinking of creating a validation rule. But I’m not sure how to create the logic.
For example:
11.123456 (acceptable)
11.12345 (not acceptable)
Field Name: Coordinates __c
Thank you for your help!
Please try below Regex sorry I missed the minimum 6 digit part.
Please mark this as best answer if this helps.
Regards,
Santosh Kumar
All Answers
Depending on your interface Lightning/VF, simply call a JS function...
Identifu the position of decimal in it.. with something like..
var dotPos = el.value.indexOf(".");
Now from dotPos check the length till end.. (Some String manipulation will help)
If less than 6, then you can give some validation error message...
Try using below Regex in your validation rule:
As Regex doesn't work with number field so you need to extract the text first and it will work s expected.
Please mark this as best answer if this helps.
Regards,
Santosh Kumar
11.1234567 (should be acceptable)
11.123456 (should be acceptable)
11.12345 (not acceptable)
Minimum of 6. Using your formula, it won't allow me to save 7 or 8 digits after the decimal, but it needs to do this.
Please try below Regex sorry I missed the minimum 6 digit part.
Please mark this as best answer if this helps.
Regards,
Santosh Kumar