May 21, 200817 yr I have a database that is used to record inspection information in my manufacturing operation. When we find bad parts, information is recorded in a separate "Rejected parts database". The two tables are related by a serial number field. I'm trying to write a script in the Inspection database to open the Rejected parts database, create a new record and copy the serial number field contents from Inspection database to the Rejected parts database. Here is what I have, that is not working: Open file["rejected parts log"] Perform script ["new record" from file: "rejected parts log"] Set Field[rejected parts log::box serial number;Final inspection sheet::box serial number] The rejected parts log opens and a new record is created, but the box serial number is not copied? I can't figure out why? I've even tried to set a variable with the data to no avail. Help.
May 21, 200817 yr Hi Bill, Perform script ["new record" from file: "rejected parts log"] Could you please share what's the contain of the Script Step? Have you tried "Copy" and "Paste" function? PS: I know this is not a good practice. It would be better to use variables (Set Variable and Set Field), but if this (Variables) did not work for you, you might try to use that (Copy-Paste). Maybe, other FM guru can give more information about using the Set Variable and Set Field for this particular case.
May 21, 200817 yr Author New record script: Go to layout ["rejected parts log"] Adjust window [Resize to fit] Move/resize windo [Current window;Top 1; Left 1] New Record/Request
May 21, 200817 yr Variable's scope is only one single file even though it $$ one, investigate this: http://www.filemaker.com/help/FunctionsRef-264.html Next question is why these files aren't related? --sd
May 21, 200817 yr I believe you need to use the script parameter here, not the script result. Something like: Perform script ["New Record" from file: "RejectedParts" ; Parameter: Inspection::InspectionID ] ... Then "New Record" script in RejectedParts Go to Layout ["rejected parts log"] New Record/Request Set Field [ InspectionID ; Get (ScriptParameter) ] Commit Record
Create an account or sign in to comment