Search Results for 'script'
-
Search Results
-
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
Hi !
I’ve a movie database in which there’s a Tag pick list, made of checkboxes. I want to find how many different records have a certain item in this pick list checked.
So thinking the pick list returned something I wasn’t sure of, I tried to get the type of the object, but all I am getting is undefined.
var value = movie_form_records[index].getFieldValue(movie_form_tags_id);
console.log(typeof value);
(console output is “undefined”)So when I try this :
var pos = value.search(“Feel good”);It never returns any item, despite the fact that some of the records have this tag. I know this because using the search filter, I can find several movies for which this tag is checked.
My loop goes through all the records and make the following test :
if (pos >-1) {
nombre++;
}But when I am running the code, I am getting the following output in the console :
2021-03-10, 8:17:57 AM / Movies / Feel good
Feel good: TypeError: undefined is not an object (evaluating ‘value.search’), line:(null)
Feel good: TypeError: undefined is not an object (evaluating ‘value.search’), line:(null)The whole code is :
function Feel_Good() {
var nombre = 0;
var movie_form = document.getFormNamed(‘Movies’);var movie_form_tags_field = movie_form.getFieldNamed(‘Tags’);
var movie_form_tags_id = movie_form_tags_field.getId();var movie_form_records = movie_form.getRecords();
for (var index = 0, count = movie_form_records.length; index < count; index++) {
var value = movie_form_records[index].getFieldValue(movie_form_tags_id);
var pos = value.search(“Feel good”);
if (pos >-1) {
nombre++;
}}
return nombre;
}So.. what am I doing wrong ? I’m a total newbie at JavaScript. So maybe I missed something somewhere.
Thanks,
Ray
So what I’m looking to do is re-build an old formulation database i built years ago in Access – where i’d have a large ingredient table with hundreds of ingredients (sugar, fats, etc – and each one of those had all their nutritional attributes stored in that same record).
There was a second table then, which had a number of drop down fields that linked back to the ingredient table – allowing me to select each individual ingredient for use in the formulation. I’ve been able to get this far in TapForms on my own.
Where I’m stuck is here: When i pull – say – sugar – from the drop down list that’s linked back to the ingredient table – what i’d also like it to do is pull and display the information for, say, carbohydrates – that is associated with the sugar i just choose. Why? Because I will then use that in a series of calculated fields to determine the quantity of carbohydrates in the precise formulation i’m working on, and get real time updates. This is what’s got me stuck. I’m not a scripter – so that’s out of my depth. Anything obvious I’m missing to help me do this?
Thanks folks
SJ