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.

lookup calc (?)

Featured Replies

In our database we are going to have these two tables Codelist (with code and status, ....) and TimeEntry (with code) We want the user to enter in the code number within the TimeEntry table which will do a lookup to the Codelist table and bring over info about that code. BUT IF status is "I" for inactive, we want an error message to appear stating that the code is invalid, and we want none of the related data to be looked up.

Does this make sense? Ifso how would we go about doing this?

Hi,

This code is valid for a relationship. But if you switched to a calculated code as the lookup key, then it won't according to your If statement.

  • Author

ok this is what I was able to come up with

[color:"blue"]

If ( FMPcodeslist::Tabs status "not"= "I" ; "Client_Code" ; "This Client Code is invalid. Please enter in correct Client code, or contact the Business Department" )

[color:"black"]

Will this keep the client_code in the field if the tabs status is empty.and give an error message if the tabs status is "I"???

or should I use a case function with isEmpty?

And if the code I have above is correct where should I put it, in autoenter or validation? because I have tried it in both locations and neither have worked.

Sorry~~~I am a newbie and some simple functions just go over my head.

Thanks

  • 2 weeks later...
  • Author

Ok i thought I figured it out, but it still doesn't seem to work.

I have also tried IsEmpty() and that doesn't work either, should I attach my files so someone can look at it?

Thanks

May be...although my answer was focused on how to prevent a lookup and didn't answered your need for a pop-up message, which probably should be event triggered involving a plug-in.

  • Author

Attached is the file, with sample data. Please let me know if any further explanation of our needs is necessary.

I am now using this code for Client_Code and it is under the AutoEnter Calculation.

Let ( [

strip = Filter ( FMPcodeslist::Tabs status ; "I" ) ;

invalidresponse = "Invalid Code: " & TextStyleAdd(Client_Code; Bold);

validresponse = Client_Code;

response = Case( IsEmpty(strip); validresponse; invalidresponse) ] ;

response )

This enters Invalid Code: and what ever code the entered so they know that the code is wrong, obviously. But it still brings over the other looked up fields.

UGO had said it would prevent a lookup but it doesn't seem to work.

Am I missing something small? Or is what we want to happen, not feasible??

lookup.fp7.zip

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.