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.

Transactional scripting & dependency on newly created records

Featured Replies

  • Newbies

Hi, I started this project using transaction to interact with the data, I used the transaction module from KarbonFM to do so. I have a situation where one of the script called during the transaction fails because it want to validate that a record exists before doing what it has to do. Because the said record is created as part of the same transaction, the script does not 'see' the newly created record via the relationship because it is not committed yet. Is there any way around that?

 

Thanks for your help

For the sake of readers here, I'll also post my response here:

Quote

Two options.

Commit before you go to the other script.
Solid error checking negates the need to validate that the record is there. If the record is in the process of being created, and does not fail, you can assume the record is there. If you are using that script from other scripts where it is expected the record is already there, you can either move the validation to before you call the transaction ( make sure everything is in place first before you execute the script ) or fork the script to account for the two different flows. Depends a lot on how you are developing.

 

Semi-quote with some updates because of context:

Quote

Getting the most out of transactions comes down to pulling out the reusable pieces, and separating them into their own script. The process of editing a record is really the same most of the time. The only differences will usually be the actual data, and which fields are being set. So handle the business logic before you send it to the script that actually sets the data or creates the records.

 

  • Author
  • Newbies

@Josh Ormond Thank you, I know we exchanged on this topic elsewhere, but taking the time to recap essential elements here as well for the benefit of as many people as possible is outstanding dedication. "Mille fois merci!"

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

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.