I have over 84,000 records. Sorting and manually scanning would not work. Is there a script to find duplicates?
I just resolved the automatic refresh of all required fields (with all their dependencies) just by changing the order of the fields and adding an if-loop to each of the calculation fields and the script field. Now i can click the “+>”-Button and all fields are refreshed without hitting CMD-R.
BTW: I had also the idea to merge the calculation fields to the script field, but i don’t know if this will do it (at the moment i haven’t the time to “translate” the formulas to javascript)…
@Brendan: Isn’t possible to add an function like << record.refreshRecord(recordID) >> which will do the same as CMD-R?
Hello,
i’m trying to refresh a new child record which i created with ‘record.addNewRecordToField’ in background.
I just don’t want to double click the new entry and press CMD-R. In the related child form there a some script and calculation fields. The problem is, that calculation 1 has an result for calculation 2 and these both has a result i use in a script field.
At the moment i have to open the new record and press three times CMD-R. This isn’t so funny that I want to do it 100 times a day…
I couldn’t find something in the javascript documentation to trigger the refresh with a script…
Had anyone had the same problem and have a solution?
Thanks a lot…
Maybe using web links instead of ‘alias attachments’ might be an option. Usingfile://nas_mounted/path/to/file.pdfas theURLopens the file, assuming that the directory is selected asScript folder access in the preferences.
In one of my uses where I have to link to several files, I use a table. Each row will point to a separate file.
In Finder, if you ctrl-click on the filename and then press the alt key, you can copy the pathname for the file. Then you can use a simple form script to set the URL field based on the just copied pathname using Utils.copyTextFromClipboard()
-
This reply was modified 3 years, 12 months ago by
Daniel Leu.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
The files themselves have the same name and extension of the target but the contents are the secure bookmark metadata so double clicking on it directly won’t work because the file needs to be resolved by the owning application (in this case Tap Forms) which then opens the actual file. Finder doesn’t seem to handle this, I ran into this when I was toying with things trying to figure stuff out.
I was looking at the file, it should have the metadata needed to reconnect the file assuming the paths are the same but I guess the security store (TCC maybe?) needs to validate it or something.
If you do the add, it’s just a copy. If you update the NAS file you need to delete it from the Tap Forms document and re-add it. Maybe with a newer version (TF6?) an expanded scripting API for interacting with the local file system might work where you could detect that and process it. I think you can sort of do some of it today but it’s more geared towards web stuff.
Is it possible to insert a chart into a layout? Ideally the chart would be fully customizable, even if that requires drawing it with javascript.
Thanks for your advice!
Hi,
how is it possible to know the name of a field in the layout mode ?
In some layouts I prefer to delete the description field in some cases or I might loose the information field by dragging the fields around. In this cases I am not able to identify the fields anymore.
I would expect this information in the inspector sidebar.
best
Andreas
Hi Eddy,
Thanks for the feature request.
You can trigger the Print screen from a Script.
Utils.printRecordsShowPanel(true);
But you can also select a layout first:
document.selectFormLayout(form_id, layout_id);
Dear Folks!
I apologize in advance. I really searched but didn’t find anything in the forum.
Here is my problem:
In my tapforms-CRM I have a button, that generates an email to the customer when clicked. Indeed, I managed, that this generates a complete addressed email with subject and text. I have also a button for phone calls. (I love tapforms for this!)
Now I would like to have a button, that prints the invoice (from the invoice-layout) or saves it as a PDF.
Of course, I know: I could just go to the invoice-layout and then choose menue>print. But I’d rather have it as a button in the CRM-layout.
Really great would it be, if there could be a script, that could be used to generate an email containing the invoice PDF as an attachment.
Thanks in advance for thinking along.
Regards,
EDDY
You can use scripting to build something like this today with the prompter and a saved search.
Create a new saved search with the criteria that you’re interested in and then you can use this to create a prompter with just the options and set the field from there. It’s not as transparent in the UI and does require executing a form script but it does give you some of the same functionality.
I’ve been trying to find a good example on the forum but don’t see one, I don’t think I have a video on it either. Might be something for the backlog.
Bingo! All it took was a decent night’s sleep before I noticed that the id was staring me in the face on the Fields panel and that I could just cut and paste it into the script.
It barfed on TIF files for some reason but I can convert these.
Thank you for your patience and assistance.
Just set the field ‘Image name’ as a script and copy my code in there and adjust the photo_id according to your form.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
Hi Daphne,
The Field Script that Daniel wrote for you does exactly what you describe.
Did you adjust the photo_id value in the script to match up with the ID of the Photo field in your own form?
When you said it didn’t work for you, what exactly happened? Were there any error messages in the console log?
Thanks,
Brendan
Thanks for your reply. I am unable to get it to work and I may not have described my problem well enough. Please bear with me.
I am creating my PDF by using the Print menu to save a PDF of a selection of database fields to a file on my system. This file, plus a copy of the images directory my database references, will be written to a flash disc and sent by post to someone. The person can then peruse the PDF and refer to the images if they wish. There may not be an image associated with every record, so the script must be able to cope with that.
Where a record does have one or more associated images my field called “Image” shows the image(s). I wish to set up a new field in each record (let’s call it “Image name”) which shows the filename of the image(s) (just the filename not the complete path). I can then include “Image name” on my printout so the recipient knows which filename to look at.
Does that make it clearer?
I assume that all your PDFs are either file attachments or photos. This field script extracts the filenames and returns them as a comma separated list.
You would need to adjust the photo_id field according to your form. Just get the id of the file attachment or photo attachment field.
function Get_Filenames() {
const photo_id = 'fld-xxx';
let filenames = []
let photos = record.getFieldValue(photo_id)
console.log("Found photos:" + JSON.stringify(photos));
for (photo of photos){
filenames.push(photo.filename);
}
return filenames.join(', ')
}
Get_Filenames();
-
This reply was modified 4 years ago by
Daniel Leu.
-
This reply was modified 4 years ago by
Daniel Leu.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks