You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

FlexField - Validators - how Boolean are managed in the Groovy expression

Received Response
40
Views
2
Comments
edited Nov 13, 2019 2:42PM in Sales 2 comments

Summary

I would like to use a boolean flexfield in a groovy expression

Content

Hello,

Imagine 2 flexfields :

  • "Flag" is TRUE_FALSE
  • "Type" has a value set (having 4 values possible : H, B, N or L, each value having a specific functional signification)

I want to create a Validator in order to raise an error with the following rule:

  • If the Type is H or B or L and Flag is false, prompt the error 'Error Message'.

I thought it easy and so the expression is :

(FlexSeg?.Type == 'H' || FlexSeg?.Type == 'B' || FlexSeg?.Type == 'L') && FlexSeg?.Flag == false

It is a valid expression but it prompt the error all the time.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!