Jump to content

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

Recommended Posts

  • Newbies
Posted

I need to get a field name and its content and paste it into another field.

This will be part of a script and the fields will be different depending on which one was selected and what option from its pulldown menu. For example: If the category selected is SAWS and the item from the list is Circular Saw. I would like to capture "SAWS: Circular Saw" and paste this into a field called Tool

I've tried different calculations but I can't get it to do what I need. I am new to FM.

Thanks.

Posted

  Quote
Maria said:

I need to get a field name and its content and paste it into another field.

This will be part of a script and the fields will be different depending on which one was selected and what option from its pulldown menu. For example: If the category selected is SAWS and the item from the list is Circular Saw. I would like to capture "SAWS: Circular Saw" and paste this into a field called Tool

Maria ...

From your post it wasn't clear whether you want to capture the actual fieldname, or whether the user first makes a selection from a "category" field, and then makes a second selection from another field to choose a specific tool.

The demo submitted by oilman deals with the latter situation. My demo deals with capturing the actual fieldname and the specific tool selected.

I think ideally what you'd want to do, if you haven't done so already, is to have a tools file, with each tool coded by "type": Saws, Wrenches, Screwdrivers, etc. This way, when the user selects the type from the "Type" field, the next pop-up ("Tool") could be set to conditionally display only tools of that type. Then a simple concatenation calculation of: Type & ": " & Tool will produce the result you're looking for.

If you don't know how to do this, I'm sure peeps will jump in here to help you.

Good luck!

capture tool name.zip

Posted

Jim,

While your demo does pretty much what Maria asked for, I'm wondering if it would really be efficient to have the fields named that way.

As you know, it is of common practice to use some abbreviation to easily identify and sort these fields while in define fields Menu, and in the development process.

Therefore, I'd rather use your "realistic" suggestion that isn't that far from Lionel's suggestion too... wink.gif

Even if a bit tedious, we could also use an external file to store all "litteral" equivalents to "fieldnames", then the litteral definition using a

SetField[t_Tool, GetField(ExternalLitteral::"t_SAWS")&":"& " "&t_Type]

Just some thoughts.

Posted

Ugo ...

Totally correct.

Also, I try to look at it from the user's standpoint. They may not have the time (or the skills required) to re-structure their system in a more efficient manner. So I think it's sometimes best to give them a solution to their immediate problem (if it's not too unrealistic), while also offering alternative ways of thinking about the structure of their files, fields, etc.

I liked your suggestion about grabbing the "literal equivalent" of the field name. Thanks!

  • Newbies
Posted

Thank you Jim and Oilman!

After looking at your files, it now seems so easy. I had tried to do it the way Jim's was scripted but it hadn't worked. Now I know why.

There are many different ways to essentially accomplish the same thing and as you say if I had structured the file more efficiently, some things wouldn't be necessary now.

Again, thanks.

Maria

This topic is 7800 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.