Sharifa Posted Monday at 05:36 PM Share Posted Monday at 05:36 PM Assignment: to copy 'work order' records per customer to save the customer time. I have two related tables . The customer table has customer details. The other table has all the 'work orders'. I have pulled in the 'work orders' into the customer as a portal. I have created a button to duplicate one record. See attached script. QUESTION: how to copy all records per customer. I have workorderID / customernumber id. Link to comment Share on other sites More sharing options...
comment Posted Monday at 06:26 PM Share Posted Monday at 06:26 PM 35 minutes ago, Sharifa said: I have two related tables . Are you sure about that? Looking at your script, I would think there are actually three tables involved in this: Customers, WorkOrders and a child table of WorkOrders (WorkOrderItems?). Otherwise I don't understand what the Loop section of your script does. Anyway, if you have a script that works for one record, you can run it in a loop for a group of records - same as you do for the records in the child table. Note that in both cases you can use the Go to Related Record script step instead of a find. 44 minutes ago, Sharifa said: copy 'work order' records per customer to save the customer time. I am not sure how exactly this is supposed to "save time". I can understand that sometimes it is convenient to duplicate a previous work order instead of creating a similar one from scratch - but I cannot see the purpose of duplicating all of them. 1 Link to comment Share on other sites More sharing options...
Sharifa Posted Monday at 07:43 PM Author Share Posted Monday at 07:43 PM The background if it helps. It's a test assignment. So figuring it out myself. It is a garden service company. A customer such as a hotel places many orders. For example, a customer has 10 orders. They need to copy these 10 orders with click of the button. see attached. Link to comment Share on other sites More sharing options...
ggt667 Posted Monday at 10:14 PM Share Posted Monday at 10:14 PM (edited) When I do this manoeuvre I do a find for the desired records, I then export as Get(TemporaryPath)/ordersAsTemplate.<<timestamp>>.FMPXMLRESULT.xml, and import this exported file to the same table, remember after this has been imported the data you just imported will be a selection and you can do replace on this if you need to prepare some data for the new template. Make sure you do an if for found set prior to export to avoid exporting all records in the table. There is no shame in making a separate layout for the purpose of this export and import. You may ask why I do XML export opposed to FileMaker Pro file type; the answer is file size, while still keeping the structure. Edited Wednesday at 07:06 AM by ggt667 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now