Jump to content
Server Maintenance This Week. ×

script and copying data from a field


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

Recommended Posts

I have a field that is specified as a button. When I click on the button, a pop-up window appears where I select what data I want to assign to the field that was clicked on for the current record. When no data is assigned to this field, it reads Please Specify Company.

I have written a script that duplicates most of the fields in the current record and puts their contents in a new record, the Company field being one of them. Unfortunately, my script is not duplicating the company name from the current record to the new record. I suspect this is because the Company field is a button that the user clicks on in order to get a window where the Company is selected.

My script steps are:

1. Go to Record/Request/Page (Previous)

2. Go to Field [select/perform; Company::Name]

3. Copy [Company::Name]

4. Go to Record/Request/Page (Next)

5. Go to Field [Company::Name]

6. Paste [select; Company::Name]

While this seems logical to me, it is not doing what I would like it to do as outlined above. Is this not possible in any version? Is it only possible in v8? Is it possible in v7, and I am just not using the proper script steps? Any insight would be appreciated.

Thanks for reading!

Edited by Guest
Link to comment
Share on other sites

I'm not quite understanding why your one filed is not being duplicated with all of the others, because a duplicate record should be the same.

You would be wise to use "Set Field" instead of copy paste here to. Copy requires the field to be on the layout, Set Field doesn't. Also, you are changing the Clipboard when you do that.

HTH

Lee

Link to comment
Share on other sites

I am not using the duplicate record (Apple+D) command. I am duplicating some of the fields on a layout when creating a new record. This is how I want to do this. I know I have a low post count, and I will not claim to be a FMP genius, but please trust me on this.

I edited my script so that the steps are as follows:

1. Go to Record/Request/Page (Previous)

2. Go to Field [select/perform; Company::Name]

3. Copy [Company::Name]

4. Go to Record/Request/Page (Next)

5. Go to Field [Company::Name]

6. Set Field [select; Company::Name]

The one field is still not having its value duplicated to the new record. Does anyone know if there is an error in my script, or am I trying to do something that cannot be done?

Link to comment
Share on other sites

You would need to copy the field before going to the new record to paste

Copy [ Untitled::Field A ] [ Select ]

New Record/Request

Paste [ Untitled::Field A ] [ Select; No style ]

Or

after creating the new record, you would need to navigate back the Previous record, copy the field then move back to Next record and past.

Go to Record/Request/Page [ Previous ]

Copy [ Untitled::Field A ] [ Select ]

Go to Record/Request/Page [ Next ]

Paste [ Untitled::Field A ] [ Select ]

Lee

Link to comment
Share on other sites

after creating the new record, you would need to navigate back the Previous record, copy the field then move back to Next record and past.

Go to Record/Request/Page [ Previous ]

Copy [ Untitled::Field A ] [ Select ]

Go to Record/Request/Page [ Next ]

Paste [ Untitled::Field A ] [ Select ]

Lee

That's a bit more efficient than what I was doing. Thanks! Unfortunately, my one (1) field is still not having its contents duplicated. I really think it has something to do with the field being a button. Can fields that are buttons only be duplicated with the duplicate record command (which is not useful in my situation).

Thanks for reading!

Link to comment
Share on other sites

In an attempt to clone the database and have it working for others to see, I found the cause of the problem. It turns out that someone who tried to do me a favor made the field I was having difficulty duplicating a field whose value was based upon a calculation. So I changed that and now life is good. Thanks for pointing me on the right track!

Link to comment
Share on other sites

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