This website uses cookies. By browsing this website, you consent to the use of cookies. Learn more.

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
- :
- Data Validation Rule ending in increments of .25

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

Highlighted
I was wondering if anyone knew how to create a data validation rule in the SFM Transaction Designer that would only allow a number field to end in increments of .25, so .00, .25, .50 and so on? I have tried setting the expression to Field__c = 1.25 just to see if it would work and it didn't.....I know this is a pretty vague explanation, but possibly somebody else has run into this problem and knows a work around. Any help is appreciated. Thank you!

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

10-20-2014
12:51 PM

1 Solution

Accepted Solutions

Highlighted

- 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