Difference between revisions of "Zoom Across"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(Initial edit. More to come.)
 
(More to follow.)
Line 1: Line 1:
 
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.
 
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.
 
{{Note|The default Zoom Across functionality allows you to zoom from one record to a destination record only if the destination table references the source table. In other words, you can zoom from an Order to an Invoice only if the Invoice references the Order in its Invoice Header. Of course you can extend this functionality - see below.}}
 
{{Note|The default Zoom Across functionality allows you to zoom from one record to a destination record only if the destination table references the source table. In other words, you can zoom from an Order to an Invoice only if the Invoice references the Order in its Invoice Header. Of course you can extend this functionality - see below.}}
To use Zoom Across, open the source window and select the source record and then click the Zoom Across icon [[file:ZoomAcross24.png]] or use the Application Menu {{MenuRef|Go|Zoom Across (where used)}}.
+
To use Zoom Across, open the source window, select the source record and then click the Zoom Across icon [[file:ZoomAcross24.png]] or use the Application Menu {{MenuRef|Go|Zoom Across (where used)}}.
  
 
==Extending the Zoom Across Functionality==
 
==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.
+
Revision 11773 in March 2010 added the capability to define additional Zoom Across targets.  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.}}
 
{{Note|Adding an Advanced Zoom rule will not affect the default behaviour.  The default Zoom Across (via foreign key references) will still work.}}
Line 13: Line 13:
 
This article shows how to add targets to the Zoom Across functionality when there are no foreign key references between the tables.
 
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.
+
You will need to log into a role with System Administration priviledges, have a working knowledge of SQL and familiarity with the ADempiere table structure to extend the Zoom Across functionality.
  
The example will  
+
The example will connect the {{WindowRef|Invoice}} and {{WindowRef|MaterialReceipt|Material Receipt}} through the Zoom Across functionality. The relation has to look across five 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.
 
+
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.}}
 
{{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.}}
  
 +
====Steps====
 +
I. Login as System with Role System Administrator (or a login and role with similar priviledges).
 +
* Open the {{WindowRef|Reference}. (Click on Reference in the menu bar or navigate to {{TreeRef|Application Dictionary|Reference}}.)
 +
* In the {{TabRef|Reference|Reference}}, create a new Reference with the following information:
 +
**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
 +
* In the {{TabRef|Reference|Table Validation}}, add the following fields:
 +
** Table: C_Invoice //This is the target table we will be trying to Zoom Across too.
 +
** 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 (Vendor)      // or the one on which the invoice is found
  
I Login as Systemadministrator
+
Now repeat the same steps but reverse the relation direction.
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
+
* Create a 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
 +
* Add the 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 where the material receipt is found
  
  
II Log in as Admin  
+
II. Login as your Admin user
  
 
Open window : System Administration/Relation Type
 
Open window : System Administration/Relation Type

Revision as of 08:34, 20 June 2010

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.

Note.gif Note:

The default Zoom Across functionality allows you to zoom from one record to a destination record only if the destination table references the source table. In other words, you can zoom from an Order to an Invoice only if the Invoice references the Order in its Invoice Header. Of course you can extend this functionality - see below.

To use Zoom Across, open the source window, select the source record and then click the Zoom Across icon ZoomAcross24.png or use the Application Menu Go{{#if: Zoom Across (where used) | →Zoom Across (where used) }}{{#if: | → }}{{#if: | → }}.

Extending the Zoom Across Functionality

Revision 11773 in March 2010 added the capability to define additional Zoom Across targets. 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.gif 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 log into a role with System Administration priviledges, have a working knowledge of SQL and familiarity with the ADempiere table structure to extend the Zoom Across functionality.

The example will connect the {{#if: |{{{2}}}|Invoice }} Window and {{#if: Material Receipt|Material Receipt|MaterialReceipt }} Window through the Zoom Across functionality. The relation has to look across five 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.gif 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.

Steps

I. Login as System with Role System Administrator (or a login and role with similar priviledges).

  • Open the {{WindowRef|Reference}. (Click on Reference in the menu bar or navigate to Application Dictionary{{#if: Reference |  » Reference }}{{#if: |  »  }}{{#if: |  »  }}{{#if: |  »  }}.)
  • In the {{#if: |{{{3}}}|Reference }} Tab, create a new Reference with the following information:
    • 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
  • In the {{#if: |{{{3}}}|Table Validation }} Tab, add the following fields:
    • Table: C_Invoice //This is the target table we will be trying to Zoom Across too.
    • 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 (Vendor) // or the one on which the invoice is found

Now repeat the same steps but reverse the relation direction.

  • Create a 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
  • Add the 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 where the material receipt is found


II. Login as your Admin user

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.