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.

Unique Value Check During Data Entry

Featured Replies

Good day Gurus,

I am trying to check if a record exist during data entry and if it does display a "new windows" with a warning, to accomplish this i am using btih "Set Script Triggers" and error capture in the below script but don't seem to work.

Field: kDocumentNumber - "Unique value" is checked

Data Entry Window:

image.png.8bebe6d8533aed4130a9abbff2b1d7a4.png

Warning Message Windows

image.png.934cfe377c1761e1350eaa5a7f7bb7bf.png

Script i executing on exit using Trigger, here i am using  

image.png.dd2996961fb27d13577d72bb33bb7a82.png

The idea is if error "504" is capture show a new windows. if not exit script.

What i am doing wrong or am i using the wrong approach to show a new windows based on an error.

Any Help is greatly appreciated

Thanks

Rudy.

image.png

  • Author

Thanks Steve,

The link was shows some useful techniques, but  was looking more for a way to do a custom message using cards.

Thanks

Rudy 

Your script cannot work the way you want.  

The Get(LastError) function returns the error number for the most recently executed script step. In your script, the most recently executed script step is Set Error Capture[] - and this will never return an error, let alone error #504. 

In order to get a validation error, you must attempt to validate the field - and you must do this before the field is validated normally. Otherwise your window will open after the built-in validation error message, not instead (if at all). Try triggering the following script OnObjectValidate:

Set Error Capture [ On ]
# TRY TO EXIT THE FIELD
Go to Next Field
Set Variable [ $error; Value:Get ( LastError ) ] 
If [ $error ]
   Go to Previous Field
   Show Custom Dialog [ Message: "Your custom message can be here, or in a new window." ]
   # CANCEL TRIGGERRING EVENT
   Exit Script [ Result: False ]
End If

Note that the error number here will be 1, not 504 (I am not entirely sure why).

 

Edited by comment

5 hours ago, comment said:

Note that the error number here will be 1, not 504 (I am not entirely sure why).

After some more experimenting:

You will get error #504 if, instead of exiting the field, you try to commit the record. However, this has the side effect of committing the record in case the entered value is not a duplicate. You may not want to commit the record at this point. 

 

  • 4 weeks later...
  • Author

thanks, go tot to work like a charm.

On 9/10/2019 at 11:47 AM, comment said:

After some more experimenting:

You will get error #504 if, instead of exiting the field, you try to commit the record. However, this has the side effect of committing the record in case the entered value is not a duplicate. You may not want to commit the record at this point. 

 

 

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.