Search Results for 'script'
-
Search Results
-
Hi,
I’m just starting the coding of scripts in Tap Forms but have come to a bit of a road block. My goal is to calculate the nutrients in my weekly food shop. So I’ve created my shopping list as a database – with he records being all the common shopping items and record fields properties of those items including their nutrients and the date they were last bought. However to create a summary of the total for each of the 100 odd nutrients for each week’s shopping list i have created another linked form with a JavaScript doing the totalling of each of the nutrients in all the shopping items In the first form (for a particular day). I am trying to use the function getTotalOfField to do this ona search of a days shopping (in the first database) but am running into errors in its use that I don’t understand how to get around. Following the example on the Tap Forms JavaScript API webpage I have found the search object and then used the getTotalOfField function on this. However I keep getting the error:
TypeError: NutrientSearch_object.getMinOfField is not a function. (In ‘NutrientSearch_object.getMinOfField(nutrient_ID)’, ‘NutrientSearch_object.getMinOfField’ is undefined)
I’ve attached screen shots of the code and resulting consult log in the hope that someone might be able to help me see what I’m doing wrong. Thanks in advance!Topic: Time delay in scripts
Hi, I’m updating entries in my database and need to access an online barcode lookup system. It only allows lookups every 5 seconds so as not to overload the server. How can I add a time delay in a script? I tried using Javascript’s setTimeout which would call a function after a specified time but Tap Forms compiler doesn’t seem to understand that. Any ideas?
Dear Folks!
I don’t know, if this is a bug of if I am to stupid…
In a script I have to call some field values.
For fields in the same form this is no problem.
record.getFieldValue(…)But if I call a field from another form, I get a error message.
The editor produces this phrase to call the value:
“XXXX.getFieldValue(…)”
“XXXX” is the name of the form, in which is the field, we need the value from.The error message is: “ReferenceError: Can’t find variable”
Where is the mistake?
Thanks in advance,
EddyP.S: My momentary workaround is to create a calculation field in my form, that calls the field value that I need and than to refer in the script to that calculation field. Working, but not really clean.
Topic: Combining Date & Time Info
I want to combine the date from a Date field and the time from a Time field into a value that can be pasted into a Date/Time field.
Using
record.getFieldValue(fieldID)on either field type does not return a JavaScript Date Object, but a string with Date and Time info.Please does anyone know how to extract the year, the month number and the day from a Date field, and the hours and minutes from a Time field?