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.

Conditional formatting field based on another

Featured Replies

I have an inventory database that shows when the price was updated by a user. The PriceMod field is a timestamp that enters the current date based on a script trigger from the price field being modified.

I want to be able to hide the pricing (which is a calculation field) on the count sheets for any items that have not had their pricing updated since Feb. 1, 2016. This way the data entry people know that current pricing still needs to be entered for that item.

I've attached a sample.  

You don't need a script trigger if the PriceMod is in the same table as the Price.  In my example, I've used auto-enter (Replace) to instead only update the PriceModified timestamp if the Price changes.  

You don't need to use conditional formatting (which can't truly hide text) when you can use Hide.

If you have any questions about the sample, let me know.  :-)

 

PriceModified.fmp12

Edited by LaRetta

  • Author

That is good to know about the auto enter calc.

But I'm still stuck. Maybe more explaining will help...

I have 3 fields that can have a price entered, based on country of origin, for each inventory item.

Then there is a calculation field called "c_MtrlsUnitCost_CDN" that gives a Canadian dollar value for the net landed cost. This field is the one that shows up on the count sheets.

So basically I want to hide or highlight any inventory item that has not had it's price updated since Feb. 1, 2016 (using the PriceMod field, that is a timestamp). 

I tried doing a conditional format on the field c_MtrlsUnitCost_CDN using this: Formula is: Inventory::PriceModDate < 2016-2-1.

This does nothing to highlight the fields with old pricing.

Inventory::PriceModDate < 2016-2-1.

 

FM does not see it as a date.  Instead, use Date ( 2 ; 1 ; 2016 ).

Oh you want to HIGHLIGHT - your original post said hide.  Either way, the answers is the same ... FileMaker sees 2016-2-1 as 2016 minus 2 minus 1 and not as a date. :-)

  • Author

Thanks LaRetta, that did the trick!

Screen Shot 2016-12-15 at 3.09.25 PM.png

Sorry I did say hide, but what I do is just make the text white if the result is true. The white does not show up when printed on white paper.

4 hours ago, skearton said:

Sorry I did say hide, but what I do is just make the text white if the result is true. The white does not show up when printed on white paper.

Just a consideration for future ...

  1. The white text may not always disappear on some monitors if accessing remote desktop and it will display through as a ghost; I've had it fail in several different situations.  
  2. Some day you may change your mind on the background color but forget that you have that conditional format as white.  It has been known to bite folks at times; it has bitten me.
  3. Conditional formatting will not eliminate field borders (if used).I'm pleased you worked it out!  

About dates ...if in doubt of your result, enter your calculation into your data viewer and check the result which, in this case, would have been 0 no matter what PriceLastUpdated timestamp was entered.  If you enter  2016-2-1 by itself in data viewer, it evaluates to 2013.  So the true calculation was being evaluated as (based up timestamp of 2016-01-07 10:50:12 AM):

63587760612 < 2013

I just thought you might appreciate understanding the logic of it a bit more ... I know I've always appreciated it when someone explains the principles behind things.  I'm pleased you've worked it out!! :)

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.