Zoom Across
The Zoom Across functionality allows you to zoom quickly from the current record to a related record in a different window. For example, if you are looking at an order, you can zoom across to the associated invoice, shipping docs and payments.
To use Zoom Across, open the source window and select the source record and then click the Zoom Across icon or use the Application Menu Go{{#if: Zoom Across (where used) | →Zoom Across (where used) }}{{#if: | → }}{{#if: | → }}.
Extending the Zoom Across Functionality
In revision 11773 in March 2010, the capability to deifne additional Zoom Across targets was added. The functionality, called Advanced Zoom, requires you to define a rule (a relation type) that finds all the relevant records in the target tables. Unlike the default ZoomAcross, the Advanced Zoom can look across multiple tables and create references based on user-defined relations. For example, you can create a rule that finds all relevant invoices for a given order via order->orderLines->invoiceLines->invoice. And it works in both directions.
Note: Adding an Advanced Zoom rule will not affect the default behaviour. The default Zoom Across (via foreign key references) will still work.
How To Configure Advanced Zoom Across
This article shows how to add targets to the Zoom Across functionality when there are no foreign key references between the tables.
You will need to have System Administration priviledges, a working knowledge of SQL and familiarity with the ADempiere table structure to extend the Zoom Across functionality.
The example will
For example Provider Invoices <-> Provider Material Receipt
The relation goes over 5 tables.
What makes things complicated is the fact that Invoices and Material receipts are shown in different windows, depending on the kind of invoices or Material receipts.
Caution! If you do not set up the reference with the correct window, a window will be shown as if a new record is about to be inserted.
I Login as Systemadministrator
Create new Reference
Name: RelType M_InOut_ID->C_Invoice
Description: Finds C_Invoice_IDs for a given M_InOut_ID
Help: We are in M_InOut and want to find all Invoices
Validation: Table Validation
Translation as you like
Table Validation:
Table: C_Invoice //the target Column: C_Invoice_ID Column shown: DocumentNo SQL: //the target
C_Invoice_ID IN (
select i.c_invoice_id from c_invoice i join c_invoiceline ivl on i.c_invoice_id = ivl.c_invoice_id join m_matchinv mi on ivl.c_invoiceline_id = mi.c_invoiceline_id join m_inoutline iol on mi.m_inoutline_id = iol.m_inoutline_id join m_inout io on iol.m_inout_id = io.m_inout_id where io.M_InOut_ID=@M_InOut_ID@
)
Window: Invoice (Provider) // or the one the invoice is found
Create new Reference
Name: RelType C_Invoice_ID->M_InOut
Description: Finds M_InOut_IDs for a given C_Invoice_ID
Help: We are in M_Invoice and want to find all M_InOuts
Validation: Table Validation
Translation as you like
Table Validation:
Table: M_InOut //the target Column: M_InOut_ID Column shown: DocumentNo SQL: //the target
m_inout_id IN (
select io.m_inout_id
from adempiere.m_inout io join adempiere.m_inoutline iol on io.m_inout_id = iol.m_inout_id join adempiere.m_matchinv mi on iol.m_inoutline_id = mi.m_inoutline_id join adempiere.c_invoiceline ivl on mi.c_invoiceline_id = ivl.c_invoiceline_id join adempiere.c_invoice i on ivl.c_invoice_id = i.c_invoice_id
where i.c_invoice_id=@C_Invoice_ID@
)
Window: Material Receipt // or the one the material receipt is found
II Log in as Admin
Open window : System Administration/Relation Type Create new entry: Name: Invoice<->Material Receipt Directed: false Source Reference: RelType M_InOut_ID->C_Invoice Target Reference: RelType C_Invoice_ID->M_InOut
III Test
- Open window Invoice (Provider)
- Select an invoice you know it has a Material receipt
- Press button "Zoom across"
-> among others, the corresponding Material Receipt will be showed.
Clicking it, a Material Receipt window will open with the material receipt related to the invoice.
It works the other way around also.