Skip links

Forum for developers and users

Customizable merchandise management system based on Claris FileMaker

Notifications
Clear all

Procedure for duplicating a document module


Markus Schall
member Admin
Joined: 13 years ago
Posts: 95
Topic starter  

Moin Moin,

As it often happens in practice that a document module has to be duplicated because, for example, further documents such as goods receipts, cancellation invoices or other documents with their own number range are required, here is an overview of what needs to be taken into account. I recommend using the tool fmCheckMate to use the fmWorkMate toolbox from Mr. Watson is included. This makes it much easier to duplicate a receipt module.

In this example we assume that we Offers duplicate to a new document module Rental agreements.

What does a document module include?

  • Tables and fields (e.g. tables Offers and Offer items with all fields)
  • Data relationships (data relationships of all linked tables in the files gFMw_Faktura, gFM_Business and gFM_Print_layouts)
  • Foreign keys in other tables (e.g. [_fk_tenancy_agreement_ID] in actions or in position attributes, if variants are to be used)
  • Scripts (e.g. lay.invoice_quotations, ts.selection_offers, all [ts.fak_offer...]-Scripts, optional ts.unt_projects_new_offer)
  • Layouts (scr.invoice_quotations, scr.invoice_list_view_quotations, iPad_Faktura_Offers, iPad.invoice_list_view_quotations, dlg.selection_offers
  • Print layouts (offer, offer list)

All these elements must be duplicated exactly in this order for the new module and some of them must be adjusted manually. To prepare for the next steps, please install the FMWorkMate tool and open the fMCheckMate tool, which should appear as a small dialog at the bottom right of your screen.

1. duplicate the tables and fields

  • Open the file [gFMw_Faktura] and open in the dialog [Field definitions] the register [Tables].
  • Select the tables [Offers] and [Offer items] and copy it to the clipboard.
  • In the fmCheckMate tool, click on the button [Convert Clipboard FM XML].
  • In the first field, enter the term Offer items and in the second field the term Rental agreement items and click on the [R] button.
  • In the first field, enter the term Offers and in the second field the term Rental agreements and click on the [R] button.
  • Enter the term offer in the first field and the term rental agreement in the second field and click on the [R] button.
  • Now click on the [>FM]-button to copy the source code back to the clipboard.
  • In FileMaker, click in the table area and select [Insert] from the clipboard.
  • The tables Rental agreements and Rental agreement items have now been added, but they still contain some incorrect calculations in fields.
  • If the document type is to have its own number range, create all number range fields and the formula in the client table. You must then also create the scripts "ts.generate_number_range" and the sub-script for resetting the number range in [lay.settings_defaults] with a subscript for your new document type. And finally, you must open the popover window [Number ranges] on the layout [scr.settings_defaults] to include the new number range.

2. create data relationships

  • Now create all relationships in the file [gFMw_Faktura]. TipSelect all relationships in the Quotations and Quotation items tables. Hold the [old]-key to duplicate the entire block. Now simply change the tables and the names of the relationships to rental agreements and rental agreement items respectively.
  • Now check all fields containing calculations in the duplicated tables Rental agreements and Rental agreement items for any errors. As a rule, it is sufficient to remove the comment characters at the beginning and end of the calculation. 

3. insert foreign keys in other tables

Now add the foreign keys [_fk_tenancy_agreement_ID] and [_fk_tenancy_agreement_position_ID] to all tables that are to be linked to the rental agreements. If the rental agreements (or your desired document type) should also be visible in the other documents in the document history, you must also insert the foreign key of the new master table into the master tables (offers, orders, etc.) of the other document types.

4. duplicate scripts

In the next step, duplicate all scripts, again with the help of the fmCheckMate tool.

  • Select all scripts to be duplicated in the script workspace and copy them to the clipboard.
  • In the fmCheckMate tool, click on the button [Convert Clipboard FM XML].
  • Enter the term offer items in the first field and the term rental agreement items in the second field and click on the [R]-button.
  • Enter the term offers in the first field and the term rental agreements in the second field and click on the [R]-button.
  • Enter the term offer in the first field and the term rental agreement in the second field and click on the [R]-button.
  • Now click on the [>FM] button to copy the source code back to the clipboard.
  • In FileMaker, click in the left column of the script workspace and select [Insert] from the clipboard.
  • Check all duplicated scripts for possible errors.

5. duplicate layouts

In the next step, duplicate all layouts, again with the help of the fmCheckMate tool. Below you will find the instructions for duplicating a layout with all the layout objects it contains.

  • Select all objects in the desired layout with [cmd-a] and copy it to the clipboard.
  • In the fmCheckMate tool, click on the button [Convert Clipboard FM XML].
  • Enter the term offer items in the first field and the term rental agreement items in the second field and click on the [R]-button.
  • Enter the term offers in the first field and the term rental agreements in the second field and click on the [R]-button.
  • Enter the term offer in the first field and the term rental agreement in the second field and click on the [R]-button.
  • Now click on the [>FM]-button to copy the source code back to the clipboard.
  • In FileMaker, click in the left column of the script workspace and select [Insert] from the clipboard.
  • Check the duplicated layout for any errors.

6. duplicate print layouts

In the last step, duplicate the print layouts. Please note that you must first add all relationships for the new document module again. Proceed in exactly the same way as before and duplicate the entire block of suitable relationships by holding down the [old]-button. Then change the relationships and names of the relationships in the same way as in the copied relationships. 

Once you have added all the relationships in the print file, you can also simply duplicate and insert the print layout(s) again using the fmCheckMate tool. To do this, duplicate the desired print layout in FileMaker and change the table origin and the name of the layout. Select all objects of the print layout and copy them to the clipboard. Carry out the steps with fmCheckMate as with all other functions. Delete all objects on the target layout, click once with the mouse in the (empty) top left-hand corner of the layout and paste the new layout from fmCheckMate. 

This topic was modified 3 years ago 2 times by Markus Schall

Greetings from Kirchhatten
Markus Schall
gofilemaker.com - MSITS


Quote

CRM, merchandise management and billing customizable with FileMaker Pro

Share:

The forum for the Claris FileMaker-based gFM-Business ERP software with CRM, merchandise management system and invoicing for Apple Mac, PC and iOS. It serves the exchange between users, developers and gofilemaker.de. The forum boards are divided into overarching topics and modules such as customer management, merchandise management or invoicing. Anyone interested is welcome to actively participate in the forum.

You are here: How to duplicate a voucher module - Billing, Vouchers & Cashbook - Support Forum for gFM Business ERP Software and Claris FileMaker