New Reminder feature

261 views
Skip to first unread message

MarcA

unread,
Mar 12, 2018, 1:21:55 PM3/12/18
to mementodatabase
Anybody have an example of how i would use the new reminder feature?
method.remind()
I understand that this will auto create a reminder for you based on a date object.

thanks
Marc.

MarcA

unread,
Mar 12, 2018, 1:23:24 PM3/12/18
to mementodatabase
Also i did look the javascript date guide but didn't find what i was looking for

Kevin Osborne

unread,
Mar 12, 2018, 6:33:50 PM3/12/18
to mementodatabase
I have tried a few methods including entry().remind(); I get no errors, but I cannot find a syntax for this documented anywhere sorry!

MarcA

unread,
Mar 12, 2018, 7:08:18 PM3/12/18
to mementodatabase
Would you be able to send me some of your examples? Maybe i can figure it out.
Tks

MarcA

unread,
Apr 2, 2018, 6:00:11 PM4/2/18
to mementodatabase
i have these two examples for auto reminders in case you need them. they work for me perfectly.

//For example, you can set a reminder to 14.00 (military time) next day from now.
entry().remind( moment().add('days',1).hour(14).minute(0).toDate());

//This formula is if you want to set the reminder based 3 days before a date field entry (datetime). at 2pm

var due = entry().field("Due Date")
entry().remind(moment(due).add('days',-3).hour(14).minute(0).toDate());

John C

unread,
Apr 4, 2018, 7:10:04 PM4/4/18
to mementodatabase
I tried this but I don't think I know what I'm doing.

Do you have to instantiate the remind function somehow? Does it work on Android?

Bill Crews

unread,
Apr 4, 2018, 7:23:55 PM4/4/18
to John Cesta, mementodatabase
I haven't tried it, but to use moment(), you'll need to click on Add JavaScript libraries and check moment.min.js.

On Wed, Apr 4, 2018, 19:10 John C <john....@gmail.com> wrote:
I tried this but I don't think I know what I'm doing.

Do you have to instantiate the remind function somehow? Does it work on Android?

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John C

unread,
Apr 4, 2018, 8:54:16 PM4/4/18
to mementodatabase
my error message says: cannot find function remind

John C

unread,
Apr 5, 2018, 8:44:55 AM4/5/18
to mementodatabase
I don't see remind in http://momentjs.com/docs/

Is this a plug in from memento?

I know they announced it but I can't find that announcement.

Message has been deleted

MarcA

unread,
Apr 6, 2018, 2:58:15 AM4/6/18
to mementodatabase
Im using an android galaxy note 5. How are you using the formula? Did you add the javascript library? Can you send me your script?

John Cesta

unread,
Apr 6, 2018, 7:08:45 AM4/6/18
to MarcA, Mementodatabase Memento
I used the exact script you provided marcA

Maybe it got screwed up by pasting it in?



On Fri, Apr 6, 2018, 7:58 AM MarcA <antum...@gmail.com> wrote:
Im using an android galaxy note 5. How are you using the formula? Did you add the javascript library? Can you send me your script?

--
You received this message because you are subscribed to a topic in the Google Groups "mementodatabase" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mementodatabase/m2L-HbtGkPs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mementodataba...@googlegroups.com.

MarcA

unread,
Apr 6, 2018, 8:14:06 PM4/6/18
to mementodatabase
My fault john. I should have mentioned to replace certain fields from my script to your fields. The first script should have worked as its not using any specific field names from your library. But the second script which is a seperate script you should replace "Your Date Field" with your date time field.

i have these two examples for auto reminders in case you need them. they work for me perfectly.

//For example, you can set a reminder to 14.00 (military time) next day from now. 
entry().remind( moment().add('days',1).hour(14).minute(0).toDate());


//This formula is if you want to set the reminder based 3 days before a date field entry (datetime). at 2pm

var due = entry().field("Your Date Field")
entry().remind(moment(due).add('days',-3).hour(14).minute(0).toDate());


John C

unread,
Apr 15, 2018, 8:20:50 PM4/15/18
to mementodatabase
I understand I have to change to my data. But no matter which way I do it I always receive the object remind not found.
Screenshot_20180416-010332.jpg

Bill Crews

unread,
Apr 15, 2018, 8:57:58 PM4/15/18
to John Cesta, mementodatabase
I don't know, John. It's not what I get. I'm running mobile 4.4.5 Pro on a Samsung tablet and get a properly set reminder, though if I test it in the script editor, it says remind() doesn't work with temporary entries, which makes sense, since there will be no real entry to hold the reminder.

Are you on desktop? The image you sent looks like mobile to me, but mine works fine.

Note: You return moment().toDate(). This causes the result to be a Date object. Is this what you want? Could this factor into why you get the message you get? Not that I know of, but something is going on.

Bill Crews

unread,
Apr 15, 2018, 9:30:45 PM4/15/18
to John Cesta, mementodatabase
Since toDate() returns a Date object, and the Date object constructor returns a string, and since remind() wants a timestamp, you should probably return toDate().getTime() instead.

John C

unread,
Apr 16, 2018, 9:26:41 AM4/16/18
to mementodatabase

John C

unread,
Apr 16, 2018, 9:26:58 AM4/16/18
to mementodatabase
On Monday, April 16, 2018 at 6:30:45 AM UTC+5, Bill Crews wrote:
> Since toDate() returns a Date object, and the Date object constructor returns a string, and since remind() wants a timestamp, you should probably return toDate().getTime() instead.

Doesn't seem to matter what I code here's what I get on my Samsung tablet 4.4.5 pro

I get this on my phone, my tablet, my pc.

Screenshot_20180416-141640.jpg
Screenshot_20180416-141659.jpg
Screenshot_20180416-141732.jpg

John C

unread,
Apr 16, 2018, 9:36:32 AM4/16/18
to mementodatabase

Maybe I don't know how this is supposed to work. I am just making a javascript type field and placing the code in it.

Bill Crews

unread,
Apr 16, 2018, 10:12:07 AM4/16/18
to John Cesta, mementodatabase
The only thing I can figure is that maybe one of those other JavaScript libraries you're using might define an Entry object of its own, which would then be the one that doesn't have a remind method?

MarcA

unread,
Apr 16, 2018, 11:52:58 AM4/16/18
to mementodatabase
John / Bill,
First i just want to state that i'm not a javascript expert. i'm learning just like everyone else. but i was looking at johns issue, and noticed that he is using the script as a javascript field entry. I used the script as an action trigger. not sure if there is a difference there but maybe.. i tested the same script as a javascript field enty like John is using,  and got the same error. my thoughts are that as a field entry it doesn't know or how to use the remind fuction in the same way.
but john, i was looking at your screenshots and had a question. are wanting to insert a date basically a day later from now? if so you could use a date function or "entry().set type of function, or something like that to set the entry, or are you wanting to use the reminder feature as a trigger?

here is an example of just setting the entry a day later. not sure what format you want but just for you to see. i tested this as a javascript field entry and worked fine for me.

moment().add('days', 1).hour(9).minute(0).toDate()

John C

unread,
Apr 16, 2018, 12:30:13 PM4/16/18
to mementodatabase


On Monday, April 16, 2018 at 11:52:58 AM UTC-4, MarcA wrote:
John / Bill,
First i just want to state that i'm not a javascript expert. i'm learning just like everyone else. but i was looking at johns issue, and noticed that he is using the script as a javascript field entry. I used the script as an action trigger. not sure if there is a difference there but maybe.. i tested the same script as a javascript field enty like John is using,  and got the same error. my thoughts are that as a field entry it doesn't know or how to use the remind fuction in the same way.
but john, i was looking at your screenshots and had a question. are wanting to insert a date basically a day later from now? if so you could use a date function or "entry().set type of function, or something like that to set the entry, or are you wanting to use the reminder feature as a trigger?

here is an example of just setting the entry a day later. not sure what format you want but just for you to see. i tested this as a javascript field entry and worked fine for me.

moment().add('days', 1).hour(9).minute(0).toDate()


Well, I do believe with your and Bill's help I may have it. You see, it wasn't that it wasn't working, it was just that I didn't know where to put it or how to use the action scripts.  

Thanks, I will continue on.

John C

unread,
Apr 16, 2018, 12:47:58 PM4/16/18
to mementodatabase
Mark, are you gettng the correct TIME back? I always get 12:00 AM

I tried using the getTime() function after toDate() but get an error upon pressing the action button.

MarcA

unread,
Apr 16, 2018, 2:13:12 PM4/16/18
to mementodatabase
Try without the getTime. But in my original script i have it set to 14 for the hour, which is 12pm always. What time are you wanting?

John C

unread,
Apr 16, 2018, 2:20:16 PM4/16/18
to mementodatabase

My thinking was that it would set itself to the time I entered in the date/time field of the record!

J

John C

unread,
Apr 16, 2018, 2:36:46 PM4/16/18
to mementodatabase
But...there I go thinking again.

Bill Crews

unread,
Apr 17, 2018, 5:37:12 AM4/17/18
to John Cesta, mementodatabase
I'm always learning how things work in various situations, sometimes differently from the standard way one would expect.

Anyway, the programmer's answer, John, if you care, is that...

Many (most?) JavaScript data types and objects return the current internal value of the variable or object when referenced. That's just the proper, civil thing to do. A purist like me would expect all variables and objects to do this. var a = b; sets the value of variable a to the current value of variable b. Also works for objects, like Integer, String, etc.

However, the inventors of JavaScript, to make things "convenient" for most programmers most of the time (so they say), they wisely (ha!) instead return different things for some data types or objects. One major example is that the Date object doesn't return its internal value (a unique integer in milliseconds), but rather a string that is readable by humans. So convenient, but it screws everything and everybody up. In order to get the internal value, so you can subtract dates, for instance, to get intervals and durations, you have to use a getTime() method. If you just return a Date object, you better want to display it as a particular string they decided you'd always want, because you won't be able to set one date to another normally, like var thisDate = thatDate; because that string screws it all up. And now, we have to teach this to people who trip over the anomaly, which makes JavaScript that much harder to learn. I'd so much rather use a toString() method to get the string and have the object return itself or its internal value, depending on context. Then, everything would just work right.

But it happened when the Web was a baby, and we've all been living with it ever since. Nobody even complains any more, except old crabs like me.

Thanks for listening to my rant. Maybe it's a useful factoid for some of you.

John C

unread,
Apr 17, 2018, 6:42:45 AM4/17/18
to mementodatabase
I created a day field in my form. So I can set the number of days ahead I want the reminder and do a 

add('days', field("days") 

kind of thing.

I just set the time to 8:30 am



On Monday, April 16, 2018 at 2:13:12 PM UTC-4, MarcA wrote:

John C

unread,
Apr 17, 2018, 8:18:51 AM4/17/18
to mementodatabase
always useful!

Vinayak Shanbhag

unread,
Feb 11, 2019, 1:04:13 PM2/11/19
to mementodatabase
a Big Thanks

As a non programmer, only after reading this , I could appreciate that a trigger for Number field can't be copied as is for used for Date field.

I had given up on a trigger. This post solved the issue.

Thanks & Regards
Vinayak

John C

unread,
Feb 11, 2019, 10:13:53 PM2/11/19
to mementodatabase
Cool.
Reply all
Reply to author
Forward
0 new messages