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.

If no records found?

Featured Replies

  • Author

I have a script that is used to import a record from one database to another(Database 1, Database 2). The script will first check to see if the record already exist in Database 2. If it does then it increases the number in a number field by 1. If it doesn't exist in Database 2 it imports the record from Database 1 to Database 2. The script I have now copies an ID # from Database 1. Then goes to Database 2, goes into find mode, paste the ID# in the ID field, and performs a find. If the Total record count > 0 it increases the number in a number field by 1. The problem I'm running into is, if there are no records found I need to import the file in from Database 1. But the script keeps ending after it doesn't find any records. Even if I click on continue. Any help you can give is much appreciated.

I have a script that is used to import a record from one database to another(Database 1, Database 2). The script will first check to see if the record already exist in Database 2. If it does then it increases the number in a number field by 1. If it doesn't exist in Database 2 it imports the record from Database 1 to Database 2. The script I have now copies an ID # from Database 1. Then goes to Database 2, goes into find mode, paste the ID# in the ID field, and performs a find. If the Total record count > 0 it increases the number in a number field by 1. The problem I'm running into is, if there are no records found I need to import the file in from Database 1. But the script keeps ending after it doesn't find any records. Even if I click on continue. Any help you can give is much appreciated.

  • Author

I have a script that is used to import a record from one database to another(Database 1, Database 2). The script will first check to see if the record already exist in Database 2. If it does then it increases the number in a number field by 1. If it doesn't exist in Database 2 it imports the record from Database 1 to Database 2. The script I have now copies an ID # from Database 1. Then goes to Database 2, goes into find mode, paste the ID# in the ID field, and performs a find. If the Total record count > 0 it increases the number in a number field by 1. The problem I'm running into is, if there are no records found I need to import the file in from Database 1. But the script keeps ending after it doesn't find any records. Even if I click on continue. Any help you can give is much appreciated.

Not sure what version you are running, but in general you use the following logic:

Set Error Capture (ON) // Lets you trap that irritating error message

Enter Find Mode

...Field Logic...

Perform Find

// 401 = No Records Found. FM Help has all the Error Codes

if (Status (CurrentError) = 401)

... Do your alternate logic here

else

... Do your normal logic here

endif

Not sure what version you are running, but in general you use the following logic:

Set Error Capture (ON) // Lets you trap that irritating error message

Enter Find Mode

...Field Logic...

Perform Find

// 401 = No Records Found. FM Help has all the Error Codes

if (Status (CurrentError) = 401)

... Do your alternate logic here

else

... Do your normal logic here

endif

Not sure what version you are running, but in general you use the following logic:

Set Error Capture (ON) // Lets you trap that irritating error message

Enter Find Mode

...Field Logic...

Perform Find

// 401 = No Records Found. FM Help has all the Error Codes

if (Status (CurrentError) = 401)

... Do your alternate logic here

else

... Do your normal logic here

endif

Rather than mess with error codes, and have to try remembering them, I use STATUS(CurrentFoundCount)= 0 then my Find turned up nothing.

Steve

Rather than mess with error codes, and have to try remembering them, I use STATUS(CurrentFoundCount)= 0 then my Find turned up nothing.

Steve

Rather than mess with error codes, and have to try remembering them, I use STATUS(CurrentFoundCount)= 0 then my Find turned up nothing.

Steve

Agreed Steve. Since Heathbo is using vs. 7, it would be:

If [ not Get(FoundCount) ] ... which is same as If [ Get(FoundCount) = 0 ] ...

... do whatever you wish when no records found ...

Else

... do whatever with found set ...

End If

I didn't want him to waste his time hunting for the ole Status() functions. Lord am I glad they are gone! Get() is more accurate, appropriate, and easier to write. wink.gif

Agreed Steve. Since Heathbo is using vs. 7, it would be:

If [ not Get(FoundCount) ] ... which is same as If [ Get(FoundCount) = 0 ] ...

... do whatever you wish when no records found ...

Else

... do whatever with found set ...

End If

I didn't want him to waste his time hunting for the ole Status() functions. Lord am I glad they are gone! Get() is more accurate, appropriate, and easier to write. wink.gif

Agreed Steve. Since Heathbo is using vs. 7, it would be:

If [ not Get(FoundCount) ] ... which is same as If [ Get(FoundCount) = 0 ] ...

... do whatever you wish when no records found ...

Else

... do whatever with found set ...

End If

I didn't want him to waste his time hunting for the ole Status() functions. Lord am I glad they are gone! Get() is more accurate, appropriate, and easier to write. wink.gif

FYI: In FM7, when no records are found, it goes back to the previous found set. So Get(FoundCount) would not work. Better to use Get(LastError)=401.

But I'm not sure Heathbo's algorithm is the best. I'd probably try something that uses a relationship between the two databases to search for those records in database 1 that have no matching records in database 2, then import the whole lot at once. For incrementing the existing records, do a similar find in database 1 for those records that do have a matching record in database 2, loop through them once, incrementing the counter in the related record in database 2.

FYI: In FM7, when no records are found, it goes back to the previous found set. So Get(FoundCount) would not work. Better to use Get(LastError)=401.

But I'm not sure Heathbo's algorithm is the best. I'd probably try something that uses a relationship between the two databases to search for those records in database 1 that have no matching records in database 2, then import the whole lot at once. For incrementing the existing records, do a similar find in database 1 for those records that do have a matching record in database 2, loop through them once, incrementing the counter in the related record in database 2.

FYI: In FM7, when no records are found, it goes back to the previous found set. So Get(FoundCount) would not work. Better to use Get(LastError)=401.

But I'm not sure Heathbo's algorithm is the best. I'd probably try something that uses a relationship between the two databases to search for those records in database 1 that have no matching records in database 2, then import the whole lot at once. For incrementing the existing records, do a similar find in database 1 for those records that do have a matching record in database 2, loop through them once, incrementing the counter in the related record in database 2.

  • Author

Thank you, it works wonderfully.

  • Author

Thank you, it works wonderfully.

  • Author

Thank you, it works wonderfully.

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.