Using Price Definitions/Tags by "entity select" Rule - not working for me

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…

Instead of show message try put a display ticket action with ticket ID =0

@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

  1. 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.
  2. Handle Order Added to Ticket rule and execute Change Order Price action with related price list parameter. You can make customer related checks here.
1 Like

Hi @emre , in “Order Added To Ticket” rule - how can i make an exception by Entity custom data?

{ENTITY DATA:Customer:NameOfCustomDataField}

so it should be:
“{ENTITY DATA:Customer:NameOfCustomDataField}” == “string”

i know that == is equal
whats the syntax for matches?

Yes, but the syntax depends where the constraint is located, and somewhat by the datatypes.

Is it a Rule constraint?

{ENTITY DATA:Customer:NameOfCustomDataField}  Equals 50


[=TN('{ENTITY DATA:Customer:NameOfCustomDataField}')]  Equals 50

Is it an Action constraint?

'{ENTITY DATA:Customer:NameOfCustomDataField}'  == '50'


[=TN('{ENTITY DATA:Customer:NameOfCustomDataField}')]  == 50


[=TN('{ENTITY DATA:Customer:NameOfCustomDataField}')]  == [=TN('50')]

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: none
Message: Data:{ENTITY DATA:Customer:NameOfCustomDataField}

Action Constraint: '{ENTITY DATA:Customer:NameOfCustomDataField}' == '50'
Message: Can you see me? If so, the constraint worked…

Once I know I have it correct, I delete the Message Boxes.

selected Action constraint in a rule, but from some reason its not working with “Equals” - it only worked for me with “Matches”

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?

Constraint box inside a selected action in a rule

the meaning of the constraint is - execute only if Entity custon data is 50 (50 as a string) - pls help with the syntax

I was thinking the same thing @Jesse, so I was confused by his answer, but maybe Action Constraints do support words such as Matches, Less

me too, then i realized its the only place to constraint an 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.

1 Like

i dont need for each price - i need to load 3 different price tags according to 3 different Entity Custom Data

If i select a customer with Entity Custom Data “50” - load a specific price (from price tags) for this product

Sorry when I said price I meant Price Tag…

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.

the thing is that i cant custom constraint “Entity Custom Data” in “Order Added to Ticket” Rule - it gives me constraints regarding Menus…

You can type your own you do not have to use pre configured.

Above is example… the update order action is not accurate that was just for illustration. You would set it up differently.

1 Like

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)

I am pretty sure it has access to this data at Order Added. It should work for what he is doing.

Here is how your action should be setup.

More accurate Rule for you to look at.

1 Like

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