Skip 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.

Using AND operator in IF Script Step

Featured Replies

  • Newbies

Hi,

I am working on an inventory management system and am having a problem. I have made a mock calculation field that looks like this:

IF(IsEmpty(fieldx)=1 and IsEmpty(fieldy)=1;"yes";"no").

This calculation works; however, when I attempt to plug the logical test into a script using the IF script step, the AND operator doesn't seem to work. If I use one of the logical test instead of both, my script runs perfect. Below is the portion of the scrip that is giving me fits.

>Else If [Get(FoundCount)<> 0]

>>Go to Last Record

>>If[isEmpty(Staging::Returned to Warehouse)=0 and IsEmpty(Packaging::Time In)=0]

>>>Delete Record

>>Else If[isEmpty(Staging::Returned to Warehouse)=1 and Is Empty(Packaging::Time In)=1]

>>>Enter Browse Made

>>>Paste....

Again the script runs fine if I only use one of the logical tests but as soon as I use the AND operator and two logical tests the thing doesn't work. Also, the fields are all in related tables. What am I missing?

I see no reason why it wouldn't work. Of course, if the tested fields are in related tables, the test considers only values from the FIRST related record in each table.

BTW, your syntax is a bit too verbose. This should work equally well:

Else If [ Get(FoundCount) ]

Go to Last Record

If [ not IsEmpty ( Staging::Returned to Warehouse ) and not IsEmpty ( Packaging::Time In ) ]

Delete Record

Else If [ IsEmpty ( Staging::Returned to Warehouse ) and IsEmpty ( Packaging::Time In ) ]

Enter Browse Made

  • Author
  • Newbies

must be something to do with the table relationship and how the tests are evaluated among the records. Thanks for the tips. Guess I'll keep trying

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.