I have 3 prices for each product – regular prices, “20” customers prices, “50” customers prices.
Entitys are defined with “Custom field” (type=string) – null is for regular, 20, 50.
I have 3 Actions type “Change Price List” for each that calls each “Price Tag”
I have 3 “Entity selected” Rules for each:
Event name: Entity Selected
Execute rule if: Matches
Custom Constraint: Entity Custom Data – Matches – 50 (for example)
So lets say in POS im selecting a customer that has 50 in his “Custom Field” expecting that all prices defined with 50 price tag will load – nothing changes, im still getting the regular prices.
The question is: am i doing something wrong? Also, is there a better way doing this?
*I have to mention that right now its working only because i added “show message” action for each rule. in those rules i had to order the “show message” action as the last one in order (before the “change price list” action), lets say that when i ordered the “show message” before the “change price list” action - i will get the message but prices will not load…
@mayase That rule changes system wide price list. Useful for happy our implementation and I don’t think that suits fine your need.
Correct implementation for your case will be
Create an Update Order action that accepts a price list variable. For example name it as Change Order Price. It will change order price to the selected price list price.
Handle Order Added to Ticket rule and execute Change Order Price action with related price list parameter. You can make customer related checks here.
That’s the general idea anyway. When I test these types of constraints, I always use a Message Box first to ensure I have the syntax correct, and that the data in question is available and being read properly. In fact, I use 2 Messages…
Action constraint works with == not Equals. Equals, Matches etc are for rule constraints. Maybe we are not talking about the same thing… did you select Custom Constraint from the rule… or are you typing this into the Constraint box inside the Action?
its not the ONLY place, you could make separate rules for each price and use Custom Constraints. Sometimes this route is best as it does not read the Action Constraint how you think it should.
I try to use Custom Constraints whenever possible just because it seems to consistently read more values than Action Constraints… maybe I am just not understanding the Action Constraints… but I always get better results using Custom Constraints whenever possible.
Make 3 Entity Selected Rules… put the Custom Constraint of
{ENTITY DATA:Customer:NameOfCustomDataField} Equals Value
Value would be your 3 price tags… you would have 1 custom constraint in each rule then the action you would set a variable for what price list to activate… you would type the Price list here.
Yes, you can. Look at my screenshot. You can use nearly anything on the Left or Right side of the Constraint. You are not limited to the choices it presents by default.
Whether or not the data is available to the Event is another question… that’s why during testing I use Message Boxes to see if the Tag is correct and the Data is available.
That said, most data is available nearly everywhere, but it may depend on certain States (Entity selected, Ticket Open, etc)
well, i tested few situations - it doesnt give me error when manually write in custom constraint, but it doesnt triggers it, anything i tried (equals…matches…contain…) - it doesnt load the correct price tag