Search Results for 'script'
-
Search Results
-
Hello everyone,
I apologize for my long post, in advance ;-)
Situation:
For my Form “Tracks” (Tracks for Hike / Bike), there are two important fields:
1) Creation Date of the Track: The date (typical date field), when the track has been created for the first time. It could be today, or in the past, not in the future. In the past only, when I enter the data today for a track, created in, e.g., 2006.
2) Track number: It is a text field with two-digit numbers 01-99. It is a text field, because of the missing leading zero (“0”) within the number fields for numbers 1-9. It is mandatory, that the track number is always a two-digit number.
2.1) The aim of the field is to have a unique number, starting with one (“01”) and should be entered manually, when a new entry is created. It is like a counter: the number of records that have been created per month. It is mandatory that each number within a month is unique.
2.2) Examples: in January, the first record is 01, the second record is 02 and the third record is 03. In February, the first record is 01, the second record is 02 and so on. March: 01, 02, 03 …
I need these two fields to create a unique six-digit track ID, which consists of the year (YY), the month (MM) and the track number (xx):
YYMMxx, e.g. 250401, 250402, 250403, 250404, 250501, 250502 …
250401 = First record in April 2025
250402 = Second record in April 2025E.g., it is today, and I would like to enter a track that was created for the first time in June 2016. This “new” record is the third record for June 2016.
The track ID should be 160603 (year = 2016, month = June, and track number = 03).
After I have entered the Creation Date (1st of June 2016), the script should tell me that for this month (June) in this year, the minimum Track Number must be 03.
As already mentioned, the problem is that I also create entries retrospectively.
My question:
Which JavaScript could I use to check which is the highest number for the the month, for which I would like to create the Track Number? Something like:
var MinimumTrackNumber = (MAX(TrackNumber)) within ( (YEAR(of Creation Date) + MONTH(of Creation Date) ) + 1; // +1 => one more, than already available. RETURN("The minimum Track Number for this track must be: " + MinimumTrackNumber);
Thanks in advance. BR
Topic: Run Fieldscript
Hi!
I have used chatGPT to create a script in a field that creates a nice Markdown filed of parts of my data. It makes it easy to save datain our devops from my meeting-notes and I can still keep track of my records.However it only works when I open up the script in edit script and clicks “save”. So I have to that when I cwant to create a markdown. Is it possible to make the script run when a post is saved?
I have tried ChatGPT here, but it only talks about functions and buttons I can’t find I tap Forms.
Hello all,
I’m just starting to learn how to use scripts in TapForms 5. I do have some knowledge of Javascript from a web programming perspective.
I thought I’d start with something simple such as create a button that deletes a record. I created the button, and assigned the following script which gets the current record, and then attempts to delete it:
function delete_record() { // get current record var thisRecord = record.getId(); // delete the record form.deleteRecord(thisRecord); } delete_record();
The console reports: “deleteRecord: TypeError: Argument does not match Objective-C Class, line:(null)”
I’m sure I’m doing something really noob here such as combining a record function with a form function.
Thanks in advance.