This website uses cookies. By clicking OK, you consent to the use of cookies. Click Here to learn more about how we use cookies.

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- ServiceMax Community
- :
- Service Flow Manager (SFM)
- :
- Service Flow Manager (SFM) Discussions
- :
- Re: Data Validation Rule ending in increments of ....

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-20-2014
12:51 PM

This widget could not be displayed.

1 Solution

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-21-2014
09:02 AM

Hi Dawn,

You can create a standard Salesforce validation rule which will display an error message in the SFM like the screen shot below and won't let the user save the SFM unless they enter their time in 0.25 increments.

**Here is the Validation rule formula to accomplish this:**

IF( AND(

CONTAINS( TEXT(test_duration__c), "."),

NOT(

OR( RIGHT( TEXT(test_duration__c), 2) == ".0",

RIGHT( TEXT(test_duration__c), 2) == ".5",

RIGHT( TEXT(test_duration__c), 3) == ".00",

RIGHT( TEXT(test_duration__c), 3) == ".25",

RIGHT( TEXT(test_duration__c), 3) == ".50",

RIGHT( TEXT(test_duration__c), 3) == ".75"

))), true, false)

Unfortunately, you can't just reference a similar formula field inside the SFM Data Validation rules since the formula won't update until the record is saved.

You may also want to try using a MOD operator formula like MOD(Duration__c,0.25) and adding some additional logic so it evaluates to true or false.

Good luck!

validationrule

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-21-2014
09:02 AM

Hi Dawn,

You can create a standard Salesforce validation rule which will display an error message in the SFM like the screen shot below and won't let the user save the SFM unless they enter their time in 0.25 increments.

**Here is the Validation rule formula to accomplish this:**

IF( AND(

CONTAINS( TEXT(test_duration__c), "."),

NOT(

OR( RIGHT( TEXT(test_duration__c), 2) == ".0",

RIGHT( TEXT(test_duration__c), 2) == ".5",

RIGHT( TEXT(test_duration__c), 3) == ".00",

RIGHT( TEXT(test_duration__c), 3) == ".25",

RIGHT( TEXT(test_duration__c), 3) == ".50",

RIGHT( TEXT(test_duration__c), 3) == ".75"

))), true, false)

Unfortunately, you can't just reference a similar formula field inside the SFM Data Validation rules since the formula won't update until the record is saved.

You may also want to try using a MOD operator formula like MOD(Duration__c,0.25) and adding some additional logic so it evaluates to true or false.

Good luck!

validationrule