December 5, 200520 yr 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 December 5, 200520 yr by Guest
December 5, 200520 yr 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
December 5, 200520 yr Author 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?
December 5, 200520 yr 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
December 5, 200520 yr If your records are unsorted, and you are not on the last record before creating a new one, then going to the previous record will NOT return you to the source record.
December 6, 200520 yr Author 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!
December 6, 200520 yr Attach a copy of your file so we can see your file and scripts. Be sure to delete sensitive data. Lee
December 6, 200520 yr Author 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!
Create an account or sign in to comment