Javascrip for Open a Library with a Button field

87 views
Skip to first unread message

Jose Angel Bonnet Perez

unread,
Dec 10, 2025, 8:22:37 AMDec 10
to mementodatabase
Hello Friends,

I am trying to open a Library using a Button field. I am sure I am doing something wrong:

// checking if library exist:
let id = "PRUEBAS BUSQUEDA DATOS PIROTECNIA"; 
let target = libById(id);
if (target) {
    target.show();
} else {
    message("Library not found or  without permision: " + id);
}

Always getting the message "not found"

On the other hand:

openLibrary("PRUEBAS BUSQUEDA DATOS PIROTECNIA");

is doing nothing

What i am doing wrong?

For sure i am not javascrip specialist

Thanks a lot  and in advance for your help

J.A. Bonnet
Canary Islands



Mmm

unread,
Dec 10, 2025, 9:55:28 AMDec 10
to mementodatabase
Было:
let id = "PRUEBAS BUSQUEDA DATOS PIROTECNIA"; 
let target = libById(id);

Нужно:
let name = "PRUEBAS BUSQUEDA DATOS PIROTECNIA"; 
let target = libByName(name);

//let id = target.id
//message(id);

среда, 10 декабря 2025 г. в 16:22:37 UTC+3, bonnet.i...@gmail.com:

David Gilmore

unread,
Dec 10, 2025, 11:16:48 AMDec 10
to mementodatabase
In case Mmm's answer is not obvious, the library ID is an identification value (usually a number), it is not the name. You want to use the library name.. Which is why your do a "libByName" instead of a "libById".

Mmm

unread,
Dec 10, 2025, 11:21:00 AMDec 10
to mementodatabase
//let id = target.id
//message(id);

Специально добавил строки, чтобы автор увидел, как выглядит идентификатор библиотеки.
Их нужно раскомментировать перед выполнением.

среда, 10 декабря 2025 г. в 19:16:48 UTC+3, aa6...@gmail.com:

Jose Angel Bonnet Perez

unread,
Dec 15, 2025, 7:44:24 AMDec 15
to mementodatabase
Hi Friends,

Thanks for your help.

In order to avoid mistakes and type mismatchs, I changed the name of the Library. Now is "MASTERPIRO" instead of "PRUEBAS BUSQUEDA DATOS PIROTECNIA" (too long)

From the desktop edition it says nothing. And doing nothing.

First, the Android with the tablet, I am giving the error "Scrip error: Can't access to MASTERPIRO

Then, checking again everything, founded that is necessary to give access permission to the scrips. There is is an icon similar to a shield.

Now, using the Android version on the tablet, it is working properly, opening the library when presing the button. But not using the Desktop version.

I will be unable to do nothing without your help.

2nd question: is possible to automate something in order to go directly with the Add option in order to get an blank form?

And 3rd question: Can the scrip return the added values to the original library started with the button?

Thanks in advande and Regards

J.A. Bonnet
Canary Islands

Mmm

unread,
Dec 15, 2025, 8:27:55 AMDec 15
to mementodatabase
Открыть запись, другую библиотеку скриптом в настольной версии нельзя.

Вы можете создать новую запись в открытой или любой библиотеке с помощью метода create().

lib().create({});//в открытой библиотеке

Вы можете задать значения полям при создании записи или будут использованы значения по умолчанию.

Вы можете получить значения из переменных при создании новой записи или из записи. 
Быстрый доступ к последней созданной записи в открытой библиотеке или другой

lib().lastEntry();//в открытой библиотеке

О многом можно узнать в справке или Вики приложения.
Возможно нужно изучить базовые сведения о JavaScript.

понедельник, 15 декабря 2025 г. в 15:44:24 UTC+3, bonnet.i...@gmail.com:
Reply all
Reply to author
Forward
0 new messages