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.

How to include ID of related record in new imported records..??

Featured Replies

I'm trying to create a way to import pictures of our items easily. I've got a little script setup that does this, the only problem is that I can't figure out how to add the ID of the product record that the picture belongs to.

Basically, I have a Products table and a Photos table related by ProductID. My script to import the photos off the camera adds new records to the Photos table but the ProductID field in these records is blank so they don't relate back to their product record like they should.

The Import dialog doesn't seem to allow access to FM variables or fields or anything like that so I can't include it in my script. Is there something I'm missing or any way I can handle this? Any information on this would be greatly appreciated. Thanks!

How do you tell which picture belongs to which product? Or do you always import pictures of one product at a time?

  • Author

Well, there's 2 options for handling that really. First, we really will most likely be importing photos for each product as we check them in...one at a time. Another option, though, is that the Import dialog has an option to import last x number of images taken on the camera. So if you can just remember how many images of that item you just took you can add that into a popup dialog in your import photos script...how many pics did you just take...5...so it'll grab the last 5 off the camera and use them for that item.

So that's where I was at when I first posted here. I do have a script that works now. It's not ideal but I think it should work ok.

Basically, the script stores the ProductID in a script variable and then after importing all of the new photos into the Photos table it moves to the Photos layout and does a find for all records where ProductID is empty. Then it loops through the found set and sets ProductID to the value in the script parameter.

I think this should work ok.

Actually, it can be even simpler, since immediately after importing a set of records, the found set *is* the imported set.

Or, if you are always importing, you could define the ProductID field to auto-enter the variable.

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.