Solved

FSM: Use Expression in Validation Business Rule

  • 5 October 2021
  • 3 replies
  • 547 views

Userlevel 1
Badge +5

Hi, 

I want to add a validation that triggers when a specific text line code is added, the text shouldn’t be longer than 240 characters.  

Unfortunately I am getting above error message. Any Idea how the syntax needs to be?

Many thanks in advance!

 

Best regards

Jacqui

icon

Best answer by Saranga Amaraweera 6 October 2021, 05:32

View original

3 replies

Userlevel 5
Badge +12

Hi @Jacqueline.Lyra 

As per my understanding you cannot use LEN() function in the business rule. In the BusinessRules document following are the functions which can be used in the business rules. 

 

Supported Function


If you want to restrict the number of character you have to change the metadata. Following is a thread which says the steps to configure the metadata.

 


Hope this answer helps.

Best Regards,
Atheeq​​​​​​​

Userlevel 7
Badge +22

Hi @Jacqueline.Lyra ,

LEN() is not a valid expression function in FSM even though it’s in SQL. You can simply create a custom view for this to check whether the task_text.text length is less than or greater than the given character length with SQL LEN function (having a boolean result column in the same view). Then create custom metadata for the same view and join that view on the task_text table with a new join relationship so that you can easily have the view’s result column as a BR rule input. Finally, you can call the validation directly from that. 

Userlevel 7
Badge +22

Adding more inputs, this can be done with a custom client script validation as well.

Reply