I think were thinking about it wrong, we need to be checking the current date against the expiry not expiry against current date. Expiry dates will always be set to the future so will always be greater and that membership is valid
What i need to know is when the expiry date has passed, so when the current date is AFTER the expiry date, so
expiry 03 07 2020
Current date 04 07 2020
current date is AFTER expiry therefore membership needs blocking until renewed
so rather than greater or smaller, which i dont think works properly with dates we need BEFORE and AFTER, but in my case i need AFTER
is it possible for your script to be amended to that it is CURRENT date AFTER expiry date?
you new script works, i just needed to swap (expiryDate >= currentDate) around so that current date is greater than expiry date, as membership expires when current date passes (get greater) than membership expiry date
ive now slightly changed the setup and use membership number as the primary field and deleted an unused custom field, none of those have anything to do with the expiry field but since i made those changed the script isnt working, on checking rule debugger its not even firing the rule on ticket entity changed
at least i know it works (and all backed up) so just need to figure out why this rule isnt firing now
I don’t know if this will fix the field removed problem. But in your original attempt to constrain the rule (nothing to do with Memo’s script), I noticed you used ADM. ADM is used Add Month(s). However, you used it on both sides, so 2 wrongs will make a right.
Here is what ADM looks like:
Here is what used for a show message action: Date: {DATE:dd-MM-yyyy}\rEntity: [=FD('{ENTITY DATA:Customers:Membership Expiry}','dd-MM-yyyy')]\rADM: [=FD(ADM('{ENTITY DATA:Customers:Membership Expiry}'),'dd-MM-yyyy')]
thanks, i have ADM in another part of my setup that Emre helped me with (I didnt know what it meant lol) but was a similar setup so was trying to work it out lol
so this is what i dont get, the system works perfect, so when the expired entity it attempted to be loaded to the ticket and is blocked the script works and the rule is fired, once customer pays their membership we press the button on the pos which asks for the customer name and new expiry date, so we type those in and the data updates fine and the block is lifted
perfect!! Almost lol
I now want to change the primary field from customer name to membership number, when i do this the script no longer seems to work and that rule doesnt fire and i cant work out why as nothing to do with the dates or rules for the date checking has been changed so now i have this
I think if you wanted to change like that would would want to create a name custom field, quick script to copy name to new name custom field, change primary then another action to copy custlm member id to primary field. Would need to check though if there is helper for updating primary/name or would need sql.
what was the reason to change?
I think I looked at similar for selecting entity more easily using numberpad entered rule.
But hastle ended up with script to get entity name from custom field.