Problem in "Button Field" script to get "Calculation Field" value.

57 views
Skip to first unread message

MR. A.S.

unread,
Aug 4, 2022, 1:37:58 PM8/4/22
to mementodatabase
Can anyone tell me if there is any problem in this script ? 

var e= entry();
var d= e.field("Total");
e.set("Final",d);

Here "Total" is a Calculation Field and "Final" is a Currency Field.

This code is not working with the help of a "Button Field" in 'Entry Card' or 'Entry Edit Card'.
 But the "Button Field" with this code is working fine in "Entry View Card". This code is also working in Trigger Script Section.

Er Mo

unread,
Aug 4, 2022, 2:41:10 PM8/4/22
to mementodatabase
Hallo
Der Befehl " entry() " bezieht sich auf den " Aktuellen Eintrag " , der ist nicht immer definirt . Wenn du das Skript Testest , weiß es nicht welchen Datensatz du meinst . Wenn du es mit der Schaltfläche ausfürst ist ein Datensatz offen und Aktuell .

Hi
The "entry()" command refers to the "current entry", which is not always defined. When you test the script, it doesn't know which record you mean. When you click the button, a record is open and Current.

Ernst

MR. A.S.

unread,
Aug 4, 2022, 3:22:22 PM8/4/22
to mementodatabase
Sir, it is not the problem. The problem is in "Calculation Field"
The script is working fine if I use any other type of field in place of "Calculation Field"
Here field "Total" is a Calculation field.
Is there any other way to write the script for "Button Field" when we will work with the "Calculation Field" ?

     THANKS 

Er Mo

unread,
Aug 4, 2022, 3:42:56 PM8/4/22
to mementodatabase
Hallo
Du musst die Berechnung von deine Berechnungsfeld in das Skript verlegen .

Hi
You need to move the calculation from your calculation field to the script.

Ernst

MR. A.S.

unread,
Aug 4, 2022, 10:53:48 PM8/4/22
to mementodatabase
Yes sir , I can get the result in this way.

But it is not working if I want to just Copy the value of a "Calculation Field" to any other field.

Everywhere it is working fine incase of any other fields except the "Calculation Field".

Incase of "Calculation Field", it is working in "Entry View" only if I press the Button there. And there is no error when I press the Play button to test the Script. But I am not getting the result in the "Entry Card" or "Entry Edit Card". There is only Blank field in place of result without any Error Message.

Is it a Bug of "Memento Apk" or anything else ?

MR. A.S.

unread,
Aug 5, 2022, 1:38:05 AM8/5/22
to mementodatabase
I think it is a Bug of "Memento Database Apk"

The script of the "Button Field" :
var e = entry();
var d = e.field("Total");
var k = Number(d);
e.set("Final" ,k);

var d = e.field("Total"); is not getting the value of Calculation field "Total".

When I am using only "d" it is giving Blank field. And when when I am using "Number (d)" it is giving 0.00 as a result . If I use "d+5" , it is giving only 5.00 as a result.

Please confirm it if it is possible to anyone.

Bill Crews

unread,
Aug 5, 2022, 2:12:06 AM8/5/22
to MR. A.S., mementodatabase
If you can build a solid case for the bug, I suggest you take it up with the developer at sup...@MementoDatabase.com. I think 4.12.0 is still in beta testing, so make sure to tell him if you are using the beta code or the base release code.

Also the normal stuff we always advise, like edition (mobile or desktop), platform (Windows, macOS, Linux, Android, or iOS), release (from Help About), and anything else you can think of that might help him pin down what the problem is.

And of course, all scenarios you know of that show the various aspects of your problem.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/c3ad6910-8f00-4fa1-87d3-3497e528bbecn%40googlegroups.com.

Er Mo

unread,
Aug 5, 2022, 2:07:09 PM8/5/22
to mementodatabase
Hallo
Das ist kein Problem , das ist Normal . Im Berechnungsfeld sind KEINE Werte gespeichert , sonder nur die Formel die zu den Werten fürt . Der Wert wirt ( warscheinlich ) bein Öffnen des Datensatzes errechnet . Ab diese Zeitpungt ist ein Wert im Berechnungsfeld , der aber wider verschwindet wenn der Datensatz geschloßen wird .

Hi
This is not a problem , this is normal . NO values are stored in the calculation field, only the formula that leads to the values. The value is (probably) calculated when the record is opened. From this point in time there is a value in the calculation field, but this disappears when the data set is closed.

Ernst
Reply all
Reply to author
Forward
0 new messages