AnsweredAssumed Answered

filtering portal on the basis of portal row records in another portal

Question asked by rounakjain on Dec 21, 2012
Latest reply on Dec 22, 2012 by rounakjain

Title

filtering portal on the basis of portal row records in another portal

Post

     http://dl.dropbox.com/u/9738427/Screen%20Shot%202012-12-21%20at%2012.07.23%20PM.png

     http://dl.dropbox.com/u/9738427/Screen%20Shot%202012-12-21%20at%2011.43.51%20AM.png

     Customer has many invoices.
     Invoice has many line items.

     Earlier, there was no "Find" Table. I used a layout based on "Customer Table" to act as the ledger account for all customers. It had a find box, an invoice portal and a line table portal. The find box presented a drop-down list of customer names. All the invoices relating to that customer were seen in the Invoice portal. On clicking a particular field in the Invoice portal, the relevant line items were seen in the line item portal. Then I thought it did not make sense to:
     1. base the layout on Customer Table since no records are to be modified or created. The ledger account is only for viewing purposes. (However, I do use a delete portal row button in Invoice portal to delete invoices)
     2. click on a particular field in the Invoice portal to see the relevant line items. I should be able to click on the invoice portal row itself to see the relevant line items.

     With this in mind, I created the "Find" table. It has find box, an invoice portal and a line table portal. Ignore the fact that some variable names start with "g" in the "Find" table, they are not global. The gFind field presents a drop-down list of customer names. All the invoices relating to that customer are seen in the Invoice portal. I then attached a script trigger to the portal's OnObjectEnter. The script sets the Find table's ActivePortalRowInvoice field to the Invoice Id of the currently selected portal row. The line item portal is filtered such that Line Table::LTInvoiceID= Find:ActivePortalRowInvoice. So I get the relevant line items correctly. So everything is working as before.
     The problem--
     There is a summary field "Balance" which shows the running balance in the invoice portal. It disappears whenever i select a row in the Invoice portal. It appears back if I commit records. It never disappeared in my earlier setup when my layout was based on Customer Table. How to make it not disappear? If I "commit record", i loose the selection of current portal row. This disturbs me since I prefer to navigate the portal via the keyboard (I have a script set for OnLayoutKeystroke).


      

Outcomes