Skip to main content
Solved

FSM Business Rule

  • December 8, 2020
  • 4 replies
  • 546 views

PirtekKH
Do Gooder (Customer)
Forum|alt.badge.img+7

Hi

How can i create a business rule to run when a request is created between 5pm and 7am.

Is there is an expression i can use?

For example something like request.created_dttm <17:00 + <07:00

Thanks

Best answer by ishD

I usually solve these logic battles with a view and compare against something simple. I might make a view and have a column that does the logic for you (sql case statement to see if the date fits the params) and outputs Y or N and the business rule simply fires if it’s a Y.

 

Lee might be able to tell us if this is bad practice.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

4 replies

Lee Pinchbeck
Ultimate Hero
Forum|alt.badge.img+24
  • Ultimate Hero
  • 1219 replies
  • December 9, 2020

Hi @PirtekKH,

You could try an expression input something like datepart(hour,request.created_dttm) BETWEEN 17:00:00 and 07:00:00. Not certain the Business Rule will like the hour extraction though.

Kind regards,

Lee Pinchbeck


PirtekKH
Do Gooder (Customer)
Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • 22 replies
  • December 11, 2020

Hi Lee

Is there a list of expressions that can be used by the business rules anywhere?

I also saw a reference to a 90 page business rule manual somewhere on the community, do you know where i can locate this?

Thanks


Lee Pinchbeck
Ultimate Hero
Forum|alt.badge.img+24
  • Ultimate Hero
  • 1219 replies
  • December 11, 2020

Hi @PirtekKH,

I am not aware of a list of expression but I believe the general rule is, if it would work as a query script run against the database directly then it should work as an expression. If it gets too complex you may need to script it instead and use that to trigger the Business Rule instead e.g. populate a temp table with the relevant records and then use a new entry in there as the input rule.

Not sure what documentation is being referred to there specifically but there is the in app documentation found by clicking the question mark in FSM at the top right when on the Business Rule page. Some documentation would also be here in the forums if you do a search of the Community. Other than that you would have the IFS Academy which is where all the proper training should be obtained from.

If you are likely to be doing a lot of work within the Business Rules beyond tweaking the odd existing one and you have not had any training in this area I would strongly recommend contacting IFS to have some training given as it is a highly useful area of the system but does take a fair bit of knowledge to use it to its full potential.

Kind regards,

Lee Pinchbeck


ishD
Hero (Partner)
Forum|alt.badge.img+13
  • Hero (Partner)
  • 91 replies
  • Answer
  • February 5, 2021

I usually solve these logic battles with a view and compare against something simple. I might make a view and have a column that does the logic for you (sql case statement to see if the date fits the params) and outputs Y or N and the business rule simply fires if it’s a Y.

 

Lee might be able to tell us if this is bad practice.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings