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.

Can a server backup script interfere with a client record creation script

Featured Replies

Hi All,

I am getting a weird record creation error on occasion and I am struggling to find the source of the error. I have an Installation creation script that is straight forward but on occasion the record is being created but the Key Field data (Contract_No) is not being entered and therefore the related record lookup data fails.

In the background of this on the system that is acting as the server a backup script is acting on an On Timer trigger. As the creation script is fairly simple I am wondering if the On Timer script may somehow be interfering with the creation script.

 

 

 

Create_Installation

# #CHECKS THAT A CONTRACT VALUE HAS BEEN ENTERED, IF NOT EXITS THE SCRIPT #

If [ IsEmpty ( Contracts::Rental ) ]

Show Custom Dialog [ Title: "Insert_Rental_Value"; Message: "THE RENTAL TERM AND VALUE MUST BE ENTERED BEFORE CREATING AN INSTALLATION"; Buttons: “OK”, “Cancel” ]

Exit Script [ ] End If

#

#MAKES SURE THAT THE USER ACTUALLY WANTS TO CREATE A NEW CONTRACT RATHER THAN JUST VIEWING IT

#

Show Custom Dialog [ Title: "Create_Installation"; Message: "DO YOU WANT TO CREATE A NEW INSTALLATION RECORD OR JUST VIEW THE INSTALLATION"; Buttons: “CREATE”, “VIEW” ]

If [ Get ( LastMessageChoice )=2 ] Show Custom Dialog [ Title: "USE_VIEW_BUTTON"; Message: "PLEASE USE THE "VIEW INSTALLATIONS BUTTON"";

Buttons: “OK”, “Cancel” ] Exit Script [ ]

End If

#

#CHECKS THAT AN INSTALLATION HAS NOT ALLREADY BEEN CREATED FOR THE PARTICULAR CONTRACT

#

Copy [ Contracts::Contract_No ] [ Select ]

Set Error Capture [ On ]

Go to Layout [ “Installation” (Installation) ]

Enter Find Mode [ ]

Paste [ Installation::Contract_No ] [ Select ]

Perform Find [ ] If [ Get ( LastError )=0 ]

Show Custom Dialog [ Title: "Installation Exists"; Message: "AN INSTALLATION FOR THIS CONTRACT NUMBER ALLREADY EXISTS"; Buttons: “OK”, “Cancel” ]

Exit Script [ ] End If

#

#CREATE NEW INSTALLATION RECORD

#

New Record/Request

Paste [ Installation::Contract_No ] [ Select ]

Set Error Capture [ Off ]

 

This is on FMP 11

More likely the copy and paste technique is the culprit.

The copy paste buffer can get corrupted so try using a $var to capture the entry and use Set Field to complete the find and record creation.

OnTimer is also not valid as a server side step.

  • Author

Hi, thanks for the response. Yes I will change the script to use a $var, I had considered that, and see if that effects anything. The database is being served from a workstation, i.e. launched and shared as there are only four users, with a launcher file being used to log in to the shared file, does that make a difference ?

So, not a true server environment, that does change matters.

FM server actually pauses dB's during copying but FM pro cannot.

Realistically using FM pro as host you cannot deliver full server facilities.

You need to control the backups to sensible points in time, or move up to server.

  • Author

OK thank you, I will try that as the frequency of errors is, I think, to great to be buffer errors as it is occurring in about 20% of Installation creations. though strangely only in Installation creations not in any other table.

It looks as though you have Set Error Capture [on] in your script, so if you were to test the value of get(lastError) immediately after the New Record step, you would know if the new record step worked or not.

 

Why do you need to do the search in Installations to determine if there is a relevant record for the contract? If the Contracts and Installation tables are related using Contract_No, then a test for count(Installation::Contract_No) > 0 from the Contracts layout would tell you if there is already a related installation record. 

 

If you allowed creation of records via this relationship, then you would be able to add a new installation record by simply writing a value into one of the installation record fields from the context of the Contracts layout, e.g. set field[installation::_timestamp; get (currentTimestamp)]  You can do your get(lastError) test immediately after this step to check if the new record was successfully created.

 

Brian

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.