Search Results for 'script'
-
Search Results
-
I have a simple requirement: for an existing record I wish to set certain fields with particular values (they are linked to pick lists).
According to the function lists I can use record.setFieldValue() or record.setFieldValues() but it is not working. Ideally I would like to use a Form script (and assign to shortcut key) as these default values only apply for some records but not others.
The script is as follows:
var name_id = 'fld-db21a48449d84ef4bfb6f4fb28473fa8'; var namex = record.getFieldValue('fld-db21a48449d84ef4bfb6f4fb28473fa8'); var deed_id = 'fld-9fe105d0c1a344b988899fafbb1f6e01'; var deed = record.getFieldValue('fld-9fe105d0c1a344b988899fafbb1f6e01'); var n_as_witness_id = 'fld-20109866d84b4587866be0cb63853547'; var n_as_witness = record.getFieldValue('fld-20109866d84b4587866be0cb63853547'); var number_of_witnesses_id = 'fld-7038bb074b3f42bca3ca6411c38ebe8b'; var number_of_witnesses = record.getFieldValue('fld-7038bb074b3f42bca3ca6411c38ebe8b'); var public_form_id = 'fld-e50974efdf284413abafd8aa9ebf36f1'; var public_form = record.getFieldValue('fld-e50974efdf284413abafd8aa9ebf36f1'); console.log(namex + " " + deed + " " + n_as_witness + " " + number_of_witnesses + " " + public_form); record.setFieldValue(namex,'James Smith'); record.setFieldValue(deed, 'Yes'); // record.setFieldValues({[deed]: 'Yes',[n_as_witness]: 'Yes', [number_of_witnesses]: '1', [public_form]: 'No'}); document.saveAllChangesproduces no errors but also does not set the fields to the defined values. I am sure there is something basic I am missing
Also is the syntax for record.setFieldValues correct?
The sample database is attached.
Help would be gratefully received.
I have posted this 5 minutes ago, but it was marked as spam and is gone… Sorry if it pos up twice later.
Im am subscribed to Sams youtube channel on which he is explaining things within tapforms, I wouldn’t have thought of before. (If you don’t know the channel, check it out, it is called pasamio.)
Watching this channel, tought me, that much more things are possible. So I wonder, if it is possible to automate the things I am doing over and over again.
If so, I would be happy to pay someone, helping me with that project, because I can’t code in Java Script (or any other language than a bit html and css).The task:
Filling tapforms with audiobook metadata.The status quo:
A simple database with one picture and some other fields. No links or anything fancy.
Files on a Mac. In a directory called “x” All in this format:
Directory named: “title [author]” or just “title”
in there:
one or more or rarely none “.m4b” files
one or none “info.txt” file
one or more “.jpg” fileWhat goes where in tapforms:
The part of the directory name “title” goes to a text field.
The part of the directory name “author” goes to a text field.
The length of all combined m4b files goes to a time field with hours / minutes
The content of “info.txt” goes to a notes field
The “.jpg” file goes to a photo fieldWhat is “automated” now:
I do a copy and paste of the content of the whole directory “x” in a text file. Then I replace all ” [” with a “;” and all “]” with nothing.
Then I import the text file into tapforms, so the “title” and “author” fields are filled.What would be the goal:
Getting all mentioned above automatically into tapforms.
– title: always there, so it should be inserted into the field in tapforms
– author: could be empty. So not even the brackets are there. Not “title []”, but “title”. If so, the field in tapforms should be empty too
– jpg: If one jpg is in the directory, it should be in the field. If more are in the directory, non should go to tapforms (I have to choose by hand)
– length: the length of all m4b files should be added and put into the corresponding field. If no m4b file is in the directory, the field should be empty
– info.txt: The content of this file should go into the notes field. If there is no info.txt, it should be empty.Importing title and author by hand is no problem at all. Getting the time in the field is the most work. Then info.txt and lastly the jpg.
If these three things could be automated -or all five – it would be fantastic.Is it possible with not so much effort?