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.

omit Duplicates not working

Featured Replies

I have written a script to omit duplicate records, but for some reason it is not working correctly. What I want it to do is do a find on the field [invoice_id] and omit empty records and then omit any duplicate invoice_id's in the list. This is my script:

Enter Find Mode

set field [invoice_id, "*"]

perform Find

Perform [sort]

go to record [First]

set field [g_invoiceid, invoice_id]

loop

if [g_invoiceid = invoice_id]

omit record

go to record [next, exit after last]

Else

set field [g_invoiceid, invoice_id]

end if

end loop

What's happening is that it omits the records even if they don't have duplicates. It omit every other records plus the duplicates. Could someone help me out and tell me what I did wrong?

Hi,

Your script will automatically delete the first record so this is where your problem starts

You have set the global field to the invoice_id of the first record, then the next step checks to see if the global = the id, and omits if it does, therefore the first record is omitted.

You need to add in got to next record.

Enter Find Mode

set field [invoice_id, "*"]

perform Find

Perform [sort]

go to record [First]

set field [g_invoiceid, invoice_id]

go to record [next] *****<<<ADD THIS LINE

loop

if [g_invoiceid = invoice_id]

omit record

go to record [next, exit after last]

Else

set field [g_invoiceid, invoice_id]

end if

end loop

Ed.

Go to next record has to come AFTER the Else in your script.

  • Author

Thank you Fitch. I appreciate you clearing that up.

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.