Search Results for 'script'
-
Search Results
-
This is a message for Sam Moffat concerning his video (https://www.youtube.com/watch?v=Juwt0OGoEkc) where he provided a script to automatically add an incremental number (from 14:14 in the video).
I have tried to replicate exactly what is shown in the video, but on adding a new record does not insert a number as Sam’s video shows.
Here is the script I created:
function Auto_Line_Number() { var orders = record.getFieldValue('fld-01d4dcc690be4cfab6e634f78da8e568'); var line_items = orders.getFieldValue('fld-fd35beba82334d6586f354d914eb1857'); console.log("found autoline number entries: " + line_items.length); var line_number = record.getFieldValue('fld-5d11f80da2e04cadbb82b52829e1be8c'); if (line_number){ record.setFieldValue('fld-5d11f80da2e04cadbb82b52829e1be8c', line_items.length); document.saveAllChanges(); return "updated line number to " + line_items.length; } return "Did not update line number, already set"; } Auto_Line_Number();Attached is the Tap Forms database.
Help would be gratefully received.
Hi,
i’m using the new JS API function
Utils.getCalendarNames()(Big thanks to Brendan for this!) in the prompter dialog to list/choose and use for my scripts:... arr = Utils.getCalendarNames(); var calname; let prompter = Prompter.new(); prompter.addParameter('Kalender: ', 'calname', 'popup', [arr[0], arr[1], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19], arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29], arr[30]]) .show('Bitte Kalender auswählen:', callbackFunction); ...1. In my case i have 30 items from the array in my list. If i have less than 30 calendars, the “missing” items in the prompter are empty. Is it possible to limit the list according to the length of the array so that only the calendars that actually exist are displayed?
2. Is it possible to sort the calendar list alphabetically?
Thanks!
Chris