Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Script Talk › Help needed with search object functions
- This topic has 5 replies, 3 voices, and was last updated 5 years ago by Nigel Hughes.
-
AuthorPosts
-
November 5, 2019 at 5:01 PM #37835
Nigel HughesParticipantHi,
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!Attachments:
You must be logged in to view attached files.November 5, 2019 at 11:02 PM #37839
Daniel LeuParticipantDoesn’t work for me neither.
November 6, 2019 at 2:10 AM #37844
BrendanKeymasterOops… It would seem that I built the methods to do these operations, but I neglected to put them in the header file.
I’ve just corrected that. So it’ll be in the next update. It works on the form. Just not on the search.
Sorry about that.
November 25, 2019 at 10:52 PM #38301
Nigel HughesParticipantHi Brendan, any idea when the next upgrade (including this bug fix) will be?
Cheers, Nigel.November 26, 2019 at 1:59 AM #38303
BrendanKeymasterI don’t have an exact timeline right now. I’m just trying to fix up a memory issue with running scripts. The memory isn’t being released properly. Hopefully not too much longer.
November 26, 2019 at 2:35 AM #38307
Nigel HughesParticipantThanks for the prompt reply. Thanks for some amazing software. (And good luck on fixing the memory issue.)
-
AuthorPosts
You must be logged in to reply to this topic.