Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

One portal for two relationships

Featured Replies

I have a table called Projects which has a dollar figure attached to it. I need to be able to debit an amount from one project and apply it as a credit to another project. I've created a relationship like so…

 

Projects --< CreditsDebits > -- Projects

 

where the CreditsDebits table has foreign id fields for "id_ProjectsCredit" and "id_ProjectsDebit" (both are the id field from Projects), as well as an "amount "field.

 

I'd like to show credits and debits in a single portal on a Project layout. Is this possible? I know I can have two portals (one for credits and one for debits), but I'd really like to combine these if at all possible.

 

Thanks!

Michael

Define a calculation field in the CreditsDebits table (result is Text) =

List ( id_ProjectsCredit ; id_ProjectsDebit )

and use it as the matchfield for a new relationship (using another occurrence of the CreditsDebits table).

  • Author

Thanks very much, comment. I think I've almost got it, but still must have something wrong. I have three relationships:

 

Projects --< ProjectsCredit >-- Projects

Projects --< ProjectsDebit >-- Projects

Projects --< ProjectsCreditDebit (using your List solution)

 

(ProjectsCredit, ProjectsDebit, and ProjectsCreditDebit are the same table)

 

On the Projects layout I have a portal to ProjectsDebitCredit.

 

In the Projects table, I have a calculation that says:

 

* * * * *

Case (
     id = Projects » ProjectCreditsDebits::id_ProjectsCredit;
 
     Projects » ProjectCreditsDebits::amount & " credit from #" & Projects » ProjectCredits » Projects::jobNumber & " (" & Projects » ProjectCredits » Projects::projectTitle & ")";
 
     Projects » ProjectCreditsDebits::amount & " debit to #" & Projects » ProjectDebits » Projects::jobNumber & " (" & Projects » ProjectDebits » Projects::projectTitle & ")"
)
* * * * *
 
For a test, I created two records in the ProjectsCreditsDebits table; one which moves $500 from Project 1 to Project 2, and one which moves $250 from Project 2 to Project 1. When I'm on Project 1's record, I get two identical entries in the portal of:
 
$500.00 credit from #002 (Project 2)
$500.00 credit from #002 (Project 2)
 
and when I'm on Project 2's record, I get two identical entries in the portal of:
 
$500.00 debit to #001 (Project 1)
$500.00 debit to #001 (Project 1)
 
The $250 transaction doesn't appear on either record. What am I missing here?
 

I am not sure what your calculation is supposed to achieve, but I suspect the fields in the portal are not from the portal's TO.

  • Author

Yes, you're correct. The calc was in the Projects table, not the ProjectsCreditsDebits table. Got it working now. Thank you!!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.