Just in case anyone else out there finds themselves smacking into the same ole' brick wall I hit today....
If you have unexpected behavior in a browser template with qRules (by "unexpected", I mean "everything works great in client, but the browser is a trip to crazytown") consider the order of your commands.
My scenario was 3 commands on a single button:
-
Delete command to delete weekend days from a group
-
Delete command to delete certain other days from the same group (holidays)
-
SortTable command to sort the parent group of the group affected by the commands in rule action 1 & 2
Finally, there was a rule action to switch views. All was swell in client - but in the browser, I was surprised to see the Delete command in rule action 2 was failing. Or was it?
I removed all the rule actions and added them back one at a time. The Delete command I was suspicious of was working as anticipated....the rows were deleted. But as soon as I added that SortTable command back in - they weren't!
Now, hopefully some IPFS guru out there will correct me if I am completely in the dark, but I suspect this had to do with postback. My button was set to always postback, but I think the postback from rule action 2 wasn't complete prior to the command in rule action 3 running. That is, even though the command worked, and the nodes were deleted, the XML available to the SortTable command was not the latest and greatest.
My solution was to move the SortTable action into its own rule, and run it first, before the deletes. In my scenario, the field I was sorting on and the order of the parent groups would not be affected by the deletion of the child groups in the other rule actions. Your scenario may be different - but if you have odd browser behavior, look to the order of your commands first.