AnsweredAssumed Answered

Clarification on moving a record to another table

Question asked by BERGSTEN on Mar 31, 2017
Latest reply on Mar 31, 2017 by philmodjunk

Hello,

 

I have an inventory database (Inventory_Main), with say, 8k records. I want to move all records with Status = "SOLD" to our Sold table (Inventory_Sold), which has say, 1k records.

Screen Shot 2017-03-31 at 3.40.11 PM.png

Would I create a scripted button to do this so I could hit it each time I sell an item out of our inventory?

 

I've found these scripts but am unsure where/how to apply them. It looks like this is a one-off script, which is good for the 58 records that currently need to be moved. After that, I need the function to be done in one click as needed (hence the idea of a button)

 

I'm also confused by $path. I don't know how to set that part up (aka how to tell it to move it to the inventory sold table). How do I figure out what the path I need is? Thanks!

 

SAME DATABASE:

Enter find mode

set field status::personal = "terminated"

perform find

set variable $path = "file:" & get(temporaryPath) & "temp.fmp12"

export records as filemaker file to $path

delete found records

go to layout for new table

import records from file $path

 

DIFFERENT DATABASE:

Enter find mode

set field status::personal = "terminated"

perform find

set variable $path = "file:" & get(temporaryPath) & "temp.fmp12"

export records as filemaker file to $path

delete found records

open file (second file)

perform script (second file import)

      go to layout (new table)

      set variable $path = "file:" & get(temporaryPath) & "temp.fmp12"

      Import records (from $path)

Close file (second file, to return to first, optional)

 

Outcomes