English Boards > V3 Development

Rules Custom Constraint

<< < (2/3) > >>

JohnS:
That's the only thing I didn't try ==

Thx Emre

JohnS:

--- Quote from: emre on July 02, 2013, 07:38:09 am ---You can use it on custom constraint area like

{:MySetting} == 1

Rule executes if MySetting equals 1;

--- End quote ---

What about strings? Do we need to enclose them in quotes?

JohnS:

--- Quote from: emre on July 02, 2013, 07:40:50 am ---Another Alternative might be using Ticket States

Ticket.IsInState("Promotion")

Rule executes if Any ticket state have Promotion Value.

--- End quote ---

And now I can't get this working.
I have set the Ticket State to Member: Discount when a customer is selected - This works.
The rule for applying item discounts has Ticket.IsInState("Discount") set as the Custom Constraint and the rule executes whether a customer has been selected or not.

emre:
Let me test that. I'll be back.

Edit: Which rule are you using to apply item discounts?

Edit 2: I've tested it and it works fine for me. There might be two reasons.

1. There might be a typo. Check Trailing spaces.
2. Not every rules can access Ticket info. You can access Ticket data from rules related with tickets like "Ticket Closed, Ticket Created, Order Added, etc."

emre:

--- Quote from: JohnS on July 02, 2013, 09:38:37 am ---
--- Quote from: emre on July 02, 2013, 07:38:09 am ---You can use it on custom constraint area like

{:MySetting} == 1

Rule executes if MySetting equals 1;

--- End quote ---

What about strings? Do we need to enclose them in quotes?

--- End quote ---

It should be:

"{:MySetting}" == "Blah"

That means we should enclose both parts.

When you have free time check http://fluentscript.codeplex.com/documentation. We are using it as the Expression Evaluator :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version