
Moin Moin,
In the following, I will explain how to add a newly developed module to the printing system so that print layouts can be created for the new module in the file "gFM_Printlayouts". Once the following steps have been carried out, a normal print dialog and any number of print layouts can be added for your new module.
To add a new module to the printing system, extensions are required in the files "gFM_Business" and "gFM_Printlayouts".

Extensions in the "gFM_Business" file
In my explanation, I assume that there are already relationships for the new module that can be used. As an example for the new relationship of your new module, I will simply use the relationship "Customers" in this article. In the "gFM-Business" file, the variable $multiline can be extended to include a partial calculation for your new relationship.
Insert the following sub-calculation into all definitions of the variable $multiline according to the following pattern, replacing "customer" with the relationship of your new module:
$modul = "Customers" AND $toc = "Customers";
If($data records = "All accessed data records";
SetVar(
[
$$sumText = "";
vResult = cfSumTextEx ( Customer::_pk_Customer_ID; Get ( NumberOfRecordsFound ) )
]; $$sumText );
Customer::_pk_Customer_ID
);
Expand all definitions of the variable $multiline, which you can find in the script "lay.print dialog" in version 6.0.3 in lines 15, 28, 49 and 217. In the "ts.print dialog" script, this variable is only defined once in line 29.
Create a new layout for the print dialog by duplicating an existing layout of a print dialog and setting the "Show records from" field in the FileMaker "Layout settings" dialog to the table of your new module.
Attention! The table of your new module must be linked to the "prf" table via a global key field such as "sGlobal".
Extensions in the "gFM_Print layouts" file
Several changes must be made in the "gFM_Printlayouts" file:
- Create a new foreign key for your new table (e.g. _fk_Customer_ID) in the "Print file" table.
- Create a new table appearance for your new table. Connect the new foreign key from table "Print file" with the primary key of your new table
- If required, create additional relationships if you also want to display data from linked tables for your new table on your print layout
With the above steps you have created your new table in the file "gFM_Drucklayouts" with all the desired relationships. In the last step, your new TOC (your new table) must now be inserted into the scripts of the printing system. A total of three scripts must be extended, whereby the extensions are identical in each case.
Make all the following changes in the "ts.Print", "ts.Create_PDF" and "ts.Create_Preview" scripts:
1. add a new subscript in the "Create new data record in the print system" area from line 72. Duplicate an existing partial script and change the TOC in each case from, e.g. "Customers" to the relationship name of your new table.
2. add a new partial script in the "Call print layout via 'GoToRelatedRecord'" area from line 221. Duplicate an existing partial script and change the TOC in each case from, e.g. "Customers" to the relationship name of your new table.
Greetings from Kirchhatten
Markus Schall
gofilemaker.com - MSITS
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.


