Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6783 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Hi, I've got a couple of instances where I want to be able to copy the field contents of a field that is not displayed on any layout but it never seems to work.

Is this is a limitation of FileMaker or am I doing it wrong?

Thanks Peter :P-)

Edited by Guest
Posted

You have given no indication of your script, your structure or your process. There is no way, given zero information, that we can answer you.

If you are using Copy script-step, then the field must be on the active layout when the script fires. But Copy is not the best choice - Set Field[] is. Are you attempting to copy a field from the current record, another record in the same table occurrence, in another table or in another file? :wink2:

Posted

It's a bit of both, you have found that copying values from invisible fields is not possible, but as such is it involving the OS in a way it should be by an application unless it's data which is carried over to another application say a spreadsheet or a wordprocessor or a webbrowser.

For the internal dealings should Set Field[ be used, and very much to our luck is it doing exactly as we would have wished copy did ...with the bonus that nothing stored in the users clipboard is tampered with. If you're are on fm7 could you make the field in question parameter for the scriptings proceedings by assigning the field to the object that calls the script such as a button.

Because only scripts called by other scripts could recieve paramters directly from scripts did we during the fm7 era make recursive scripts to pick up field values for paramters, which made the readability of a script a rough ride, did filemaker with fm8 introduce $variables (both globals and locals) as well as script results ...the nice thing is that the script as object then can carry values....

--sd

Posted (edited)

I've got a couple of calculation fields, only one needs to be visible on the layout. The other is a shorter version of the first in upper case that I copy to paste into another program. I just want to press a button that copies this field that isn't displayed.

I have a script that changes the calculation result depending on a trigger field, copies the result and then changes it back to the normal displayed result but thought this was long winded and messy. I was hoping there was a simpler solution.

Cheers Pedro :)-)

Edited by Guest
Posted (edited)

The Copy script-step (which you will need to use to put the contents onto a User clipboard) requires that the field be present on the layout. But it doesn't have to be seen. Try this:

Place the Upper() calc on the layout. Right-click and uncheck Allow Entry in Browse and Find. Change pen pattern and fill pattern to transparent (top left box). While still selected, View > Object Size. Click the in which will toggle - stop at px. Put a 1 in each of the two bottom options (width and height).

Poof gone.

Script would be only:

Copy [ Select ; UpperCalcName ]

Commit Records/Requests

You should consider preserving the User clipboard contents first. If you need help with this, let us know.

UPDATE: Oh. Remember where you put this invisible field. Sometimes I use an invisible object lower right to designate the size of window on Resize To Fit so if I need an invisible field, this is where I place it also. If you rework your layout, you might forget it's there and delete it by accident so remember any 'one specific' area that might hold invisible objects. Another option is to freeze the window, go to a layout containing the field and then go back. Users would never know. I use developer tables where this kind of work takes place. It's whatever you feel most comfortable with...

LaRetta :wink2:

Edited by Guest
Added update
Posted

Hi Peter: congrats on the soccer game of the Oz-team!

Uhm, why would you need the copy step? As Soren points out, set field is the step to go for. Or set variable. I know that you can hide a field on a layout and use copy anyway, but from the standpoint of maintenance and as little chance of error as possible, I would usually advise against it. The only exception being the copy all records script step, with which you can copy a big set of field values from a layout that just contains that specific field.

IF you opt to use copy, why not build a small system layout, freeze window before starting the copying, going to that layout, do the copy and switch back? It is easier to maintain and at leas the risk of you, one day in the future, wondering why the heck that hidden field is on the layout and deleting it....

Posted

Nice. It's so easy to forget that a script can use copy/paste on fields with disabled entry. But I would start with a Freeze Window, otherwise you'll get a flash if the field is too small for its text (and it most likely will be, hidden like that).

BTW, wouldn't the most natural place to hide the field be under the copy button?

Posted

Thanks to everyone who suggested ideas, given the situation I might keep my orginal solution that changed the calculation based on a flag field.

When the script is run it, sets the flag field, displays the desired result, copies the data and finally sets the flag field back so the normal calculation is displayed.

Cheers Pedro :)-)

Posted

Well gee, Tricky. Thanks for echoing exactly what I said in my post and also for pointing out that Soren pointed out what I pointed out (about Set Field[]) in my first post. But Set Field[] won't work to copy. Set Variable? How is one supposed to copy variable to clipboard? But it's good to hear the same things rephrased a bit differently.

Under the button indeed, Michael! :wink2: Invisible fields can come in handy (see attached). I learned field popping from CobaltSky in vs. 6. It works like a spoiler. One can use it as the design lines themselves by applying fill color and it becomes just another line. With long text, Tool Tips won't stay open long enough and User must reselect the field over and over which is irritating; whereas a popped invisible field will stay open until User deselects. The Freeze Window DOES stop flash! And I would bet it works in the value list scroll demo (you posted) as well but just wasn't as noticeable!

Now everyone ... don't jump on me because I'm presenting something strange. In this instance, it saves another layout and yes, you can put it in a tab but you may not want tabs on a particular layout. This is just another technique to keep in your bag of tricks and it might come in handy. Knowing FM doesn't care about field height and will still expand properly to show all text regardless of the size, is a good thing to know. And so is knowing you can copy fields with entry turned off.

Invisible.zip

Posted

that Soren pointed out what I pointed

Thats way too bad the way you pride yourself :), When I started to write a reply no-one have chimed in yet, but during the process to make effords in a foreign language, had your post popped up... take a look at the timestamps only 7 minutes between the two posts, which certainly would have been less if I mastered english better!

If I were to quote you, would I dspite the readbility have done it in quote boxes!!! Alright this isn't rocket science this, but it was my integrity what you made a laugh about!

--sd

Posted

Hi LaRetta,

What a neat trick, I like it a lot.

A BIG Thank You for sharing it.

Lee

Posted (edited)

Oh Soren... I knew when you posted that it was an overlap. I assure you I meant nothing derogatory; I was just surprised that Tricky didn't catch that I said it as well, saying my suggestion of a copy method wasn't required. It struck me as humorous. I had put a smilie afterwards but ended up deleting it because Genx says I use too many smilies! :wink2::wink2:

Thank you, Lee!

Correction: Genx didn't say I use too many smiles ... he said 'you sure like those smilies' which made me think I might use them too much. Honestly everyone ... I'm always smiling just like those little critters. If I ever DON'T put a smilie, that doesn't mean I'm not smiling. :wink2:

Edited by Guest
Corrected
Posted

I am relatively new to this forum, as is visible via the number of posts behind my name. And although I like the exchange of information, it surprises me how sarcastic people can be sometimes. It not only surprises me, it is demeaning as well when intentions of poster are nothing but good. Well, mine are, in any case.

So, I would like to suggest that personal comments about whether or somebody mistakenly posts something that was already suggested and overlooked, are entered in a private topic or simply not made. It is of no value to the topic, it looks very childish as well, like knocking on your chest because, hey, after the brilliance of your own reply, why would others duplicate your comments? Or: how stupid are the others for repeating my words?

You are right, in that I saw that I did say the same things you did. I could have done a better job reading, but again: it seems very unnecessary to word your reply the way you did. If you would have added the smiles it might have looked differently. But, anyway, I like good fun, so I will choose to take it this way.

Posted

I was just surprised that Tricky didn't catch that I said it as well

You saw that as demeaning? That was not my intent.

By the way, you do not post two paragraphs of highly offensive personal attack on someone ... end it with 'taking it in good fun' and expect it to work. I didn't see even ONE smiley face on your post.

:wink2::wink2::wink2::wink2::wink2::wink2::wink2: :wink2:

Posted

Okay, I hardly ever use them, let me give it a try and forget about this. After all, in the end we all love Filemaker and want to get better, amongst other things through this forum.

:):P:):):):):):):):):) :)

This topic is 6783 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.