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.

Featured Replies

I'm using a modified version of the Invoices Starter Solution form FM13 and I've added a boolean field to the Invoice Data table which indicates if it has been ordered or not.

What I'd like to do is add a boolean calculated field in the Invoices table which looks at all related records, all the items on the invoice, and if they've all been ordered it's 1.

If I create the calculated field in invoices and set it to If(InvoiceData::Ordered=1,1,"") it works as long as there's only 1 item.  If there are two or more items it just moves in lock step with the first item and ignores the rest.

Any way to do this without a script?

Thanks,

Isaac

A calculation that references a related field gets the data from the first related record only. In order to consider all related records, you need to use one of the Aggregate functions. Try something like:

Sum ( InvoiceData::Ordered ) = Count ( InvoiceData::OrderID )

Personally, I would prefer to make Ordered a Date field, and count it instead of summing it.

  • Author

That's brilliant, that should work.  

As far as your preferred method, how would you count a date field?  I do have an ordered timestamp field which just puts in the time when the ordered checkbox was checked.

Thanks for your help!

Isaac

48 minutes ago, Isaac Knoflicek said:

how would you count a date field?

Just like that:

Count ( Related::Datefield )

returns the number of related records where Datefield is not empty.

 

48 minutes ago, Isaac Knoflicek said:

I do have an ordered timestamp field which just puts in the time when the ordered checkbox was checked.

I don't think you need two fields for this. A button that populates/clears the timestamp field should be quite sufficient. And you can use conditional formatting to display a tick mark when the timestamp field is not empty.

 

Edited by comment

Create an account or sign in to comment

Important Information

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

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.