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.

Revert Record if field in portal equals a certain value

Featured Replies

Hello forum. 

What I am (hopefully) trying to accomplish is the following:

A user goes into a portal (Sessions) to enter (create) a new related record.  On the portal row is a field called 'Exercise' tied to a value list of available exercises.  The first line in the value list is "-Add New-".  If the user selects this, they are able to create a new exercise (via magic key).  All of this works fine.

However, if the user selects 'Cancel' in any of the script steps, they are able to later, commit the record with "-Add New-" as an entry in the Exercise field (on the portal). 

I would like to revert the record.

So I tried this script, which doesn't revert the record.  In the Data Viewer Watch tab I see the result "-Add New-", but in the script, it just skips over this step and commits the record.  I noticed the Data Viewer Current Tab shows the first portal record, which means even with the proper portal row field in focus, anything that could cause a commit is losing focus on the field.

The simple script:
 

If [FilterValues (List (SESSIONS::Exercise) ; "-Add New-" )]      
    Revert Record/Request [No dialog]
End If

Any thoughts or help are always appreciated

Thanks

Steve

FM Pro Adv 12

13 minutes ago, Steve Martino said:

If [FilterValues (List (SESSIONS::Exercise) ; "-Add New-" )]

I believe that needs to be:

If [not IsEmpty ( FilterValues ( List ( SESSIONS::Exercise ) ; "-Add New-" ) )] 

if it's ever to return true. What you have returns either "-Add New-" or an empty string - and none of these will return true when converted to a Boolean.

--
P.S. I haven't followed your process that well - note that Revert Record will revert all uncommitted records.

 

 

 

  • Author

Thanks Comment (again, and again).  Yeah that worked!

In this instance, it's ok that all uncommitted records revert.

Thanks again

Steve

 

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.