1 Reply Latest reply on Jan 18, 2010 9:14 AM by philmodjunk

    Script to find record and paste data



      Script to find record and paste data


      I have a script that I wrote about 15 years ago, and it's stopped working.  I can't figure out how to fix it.


      I have two databases - an invoice database and a product database.


      I need to copy an item number from the invoice database, find that item in the product database, and then enter the current date in a "sold date" field in the product database.


      It seems like this should be simple, but I can't figure out how to script a find based on the copied value of the item number.


      FM Pro 10, Macintosh system.   Thanks in advance - this is driving me crazy.

        • 1. Re: Script to find record and paste data

          How are you "copying" the value? The copy and paste script steps will fail silently (no visible error message) if the referenced field is not on your current layout--that's one possible explanation here.


          What version of Filemaker are you using?


          If it's new enough to support passing a parameter to a script, you could pass the item number as a parameter to a script in the second database.

          In Invoices, your script would include this line:

          Perform Script ["YourExternalScriptName" from file: "ProductDatabaseFileName" ; Parameter: Invoices::YourItemNumberField]


          In your Product database, you'd have a script like this:

          Enter Find Mode[]

          Set Field[Product::ItemNumber; Get(ScriptParameter)]

          Perform Find[]

          Set Field [Product::Sold Date ; Get ( CurrentDate) ]


          If you can't pass a script parameter, you could store the item number in a global field instead of using copy/paste.