Search Results for 'script'
-
Search Results
-
Topic: Script to Add File Alias?
First of all, thank you for this excellent program.
I have a form with a lot of records: 10 years, day by day, one photo per day. At the moment I prefer that the images are outside of Tap Forms, and now they are, as an alias, in a “web-website” field.
I’m new to Javascript and I’m trying – probably wrongly – to copy the link in the “web-website” field to a “File-Attachment” field, with this script, trying in 2 ways:
function CC1 () {
// Get image-link-from-web-field
let image_id = 'fld-8f9c8612cbc04ebfb422576213cebf74';
let image_link = record.getFieldValue (image_id);// way A - Copy to file-attach-field-as an alias
record.addFileFromUrlToField (image_link, 'fld-05f12a9a7da74079b354a02e7c5bb305');// way B - Copy to file-attach-field-as an alias
//record.setFieldValue('fld-05f12a9a7da74079b354a02e7c5bb305 ', image_link);form.saveAllChanges ();
}
CC1 ();
What am I trying to do is possible? Or should it be done manually by clicking “Add File Alias”icon?
Thanks a lot! Ricard Casals
I have an iMac and a Macbook. Something went wrong in my database a couple of months ago and I only noticed it this morning. A form with scripts had been erased. Anyway, I had a backup and was able to restore it on my iMac.
But before proceeding, I inactivated syncing, deleted the iCloud syncing data from my iMac. Turned off syncing on my Macbook too (from Tapforms) and deleted the local copy.
At this point, my database is on my iMac. I re-enabled syncing. I saw that the last upload date and time was corresponding to when I re-enabled syncing, after a couple minutes. So, on iCloud, it would seem that all is good.
On my Macbook, my database won’t sync fully. When I launched Tapforms, my database appeared with a cloud sync icon. When I try to open it, it shows an empty database. I’ve been patient, waited a long time, closed the database and waited, but the file never goes over 2.6 mb in the Finder. The real file size is 154 mb (or close to).
What else can I do to get my database from my iMac to my Macbook.
Note : I know the database is on iCloud sync because on Tapforms for iPhone, the database is all there, up to date.
Thanks,
Ray
Hi,
I’m looking for a way to change a name field when a person is deceased.
I currently have a ‘Full Name’ field (concatenated from other name fields, with a grey background) and a ‘Deceased’ check box.
When the check box is ticked I would like the ‘Full Name’ field to have a black background with yellow text.
Sounds simple enough but I’m a newbie to scripts so not sure how to trigger the change when the check box is ticked.
Any help would be gratefully appreciated.
Many thanksTopic: Help with a script 2
The Swedish farmer has received successful help with earlier scripts.
But there is a need for one further script and the knowledge in JavaScript is still nonexistent.
So help with a form script is most welcome!!
A document template of “Djur” is enclosed.This is the background:
In the form “Kalvningar” are calves from the season listed. They will be split into three groups:
– female calves kept for breeding
– female calves for sale (the rest)
– male calves for saleThe script should perform the following:
Go through all the calf records and check:
1. if a female calf and the field “Utgångsorsak” IS NOT empty (breeding info already entered): enter a transaction date in the field “Utgångsdatum” for each record and make a copy of these records with information in fields “Utgångsdatum” and “Utångsorsak” deleted ie. empty and transfer these copies over to the form “Rekryteringsdjur”.
2. if a female calf and the field “Utgångsorsak” IS empty:
– enter a sales date (to be typed in) in field “Utgångsdatum” and the information “Försäljning” in field “Utgångsorsak”.
3. if a male calf and the field “Utgångsorsak” IS empty:
– enter another sales date (date of sale for males and females not the same) in field “Utgångsdatum” and the information “Försäljning” in field “Utgångsorsak”.If both the fields Utgångsdatum” and “Utgångsorsak” IS NOT empty: go to next record.
Finally should the group information in the field “Grupp” in the form “Rekryteringsdjur” for all records in that form be deleted so that the field is empty.
Now the data base is prepared for a new calving season.
I’, new to Javascript and relatively new to TapForms. I need to replicate the “Select and link existing records” function in a script. In certain circumstances I am creating a new “transaction” (new record) inside a script (using AddNewRecordToField) and once created I need to set the “Link From Field” to an existing “account” record in the script so that the user doesn’t have to take the extra records to go to the subform and select (probably the wrong) “account”, or even worse, not select one at all.
In summary:
1. A new transaction item is created in a script using AddNewRecordToField();
2. I need to update the “Link from field” to select an existing account record inside the script;Is this possible, and if so how would I do it?