"lib" is not defined

123 views
Skip to first unread message

D. H. B. Marcos

unread,
May 25, 2018, 4:30:23 AM5/25/18
to mementodatabase
Hi. I'm a PRO user of Memento 4.4.5. I created a new library to test lib() function in JavaScript field. I created this field and wrote, according with http://wiki.mementodatabase.com/index.php/Memento_JavaScript_Library#Object_Library:

var l = lib();

However I received error:

ReferenceError: "lib" is not defined. (field.js#1)

Please, can you help me to get and parse all items of a library?

Ashwar Sadh

unread,
May 26, 2018, 3:07:27 AM5/26/18
to mementodatabase
lib() does not work in JavaScript fields, but works in scripts
You can make a text field and set it's value from script using before/after saving an entry triggers.

D. H. B. Marcos

unread,
May 26, 2018, 1:21:55 PM5/26/18
to mementodatabase
OK. I will try it.

Well... I have a feature proposal, then. 😀

Even so, Thank you so much!

Bill Crews

unread,
May 30, 2018, 6:06:43 PM5/30/18
to mementodatabase
JavaScript fields were the first JavaScripting implemented in Memento -- before triggers, actions, etc. They were introduced to supply similar function as Calculation fields and are designed to be as simple and easy to learn as possible. They are limited to the current library, unless a Link field takes then elsewhere, and to the current entry, so lib() and entry() are assumed, so to speak. No need to refer to them.

JavaScript fields do not have access to the Memento JavaScript Library.

Reply all
Reply to author
Forward
0 new messages