SambaPOS Obsessed with Random Date

Hi everyone,

I am trying to update entities custom data as a date. Program settings gets saved properly, Show Message action returns the right value but once its updated no matter what the date is it always writes in 07-15-2020, I have no idea why is it so obsessed with that date.

Also, shouldnt the prompt text be opposite contrast?

Custom fields

Prompt question text has been like that for a few versions, yes it should be white.

Date thing is odd, guessing its related to topic of dash in entity custom field that has come up a few times recently.
Try adding a space in front of the prompt square brackets. Although you have a mask set…
Whats the system date format?

Yes, it related to that previous topic but not the same issue.

Ill try adding space

Systems regional settings are dd-MM-yyyy

I tried everything from different masks, different field types, different setting name, tried pulling just {DATE:MM-dd-yyyy}. My head is so full today that Ill just leave it until tomorrow, hopefully it will click lol

personally I set system to yyyy-MM-dd as thus keeps things easier is scripts as is then in same format as in the database sql format.
Think the issue is within prompt as I have dates with dashes in entity fields updated via script without issue. Maybe pass through a script with update entity.

Reckon I should use?

api.Entity({LOCAL SETTING:GCEntityName}).Fields(Expiry).Update([=FD(ADD('{DATE}',7),'MM/dd/yyyy')]);



Are you updating via message server / graphql outside SambaPOS? If so, it is possible it is using the Windows regional settings for the user that message server runs under.

You can also try “Override Windows Regional Settings” here:

The only time I saw this happen was like I say, orders created via graphql like those from Gloriafood through a custom integration. The way I resolved it was specifying date format using {DATE:X} but you said you tried that and it’s not working?

I havent tried doing it through scripts yet but Ill keep this in mind.

In the GIF I uploaded its M-dd-yyyy but I also tried MM-dd-yyyy format, it always seems to pick up this odd 15-07-2020 date. I just have no idea where is it pulling it from. (nothing of importance happened on this date right? :sweat_smile: )

Ive tried pulling settings after the automation and it would show me what I actually put in originally. I even tried assigning it through the rule without the [?Prompt] , result is the same.

I actually dont see anything wrong with this rule.

Ill try few more things tomorrow to get to the bottom of why it behaves this way and it doesnt go through Ill just make a simple script and use API to do it instead.

Set entity field type as Date maybe?

Or maybe the mask is wrong

I couldn’t resist so I opened it up again and tested it and it works!

I am not sure which one actually fixed it but here are the things Ive done:

  1. Changed the regional date formatting to MM-dd-yyyy to match the automation within POS
  2. Set the Field Type as String
  3. Set the Mask Type as Date Time
  4. Set the Editing Format as MM-dd-yyyy to match both automation & regional settings

I successfully created a new entity & account with the right expiry date. +7 days from the date of issue.

To test that is not just a variable with symbols and numbers and it can be reformatted I pulled it up in a show message in a different format and works like a charm.

Thank you guys for guiding me in the right direction!

1 Like

I used the seccond one. Also setting values cant be called like that in scripts.

I know, I was going to load up setting value. It was just so you understand what I am trying to do