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.

Done a script to move data from one record to date woes

Featured Replies

Hi

I have recently written a script that copies data from a bunch of records into another database recordset. The problem is, even though the script I feel is close to perfect, for some reason all records from my Database get copied to the other database, even when I have an 'if' statement to make sure that I am only copying the files over that I want.

This is the structure

Quote_Database - Quote_Item_Database

Order_Database - Order_Item_Database

I am trying to copy (duplicate is the better word probably) certain records from Quote_Item_Database into Order_Item_Database and create a new Order in Order_Database to make the relationship intact.

Is their any hints anyone to give when doing such a thing? I have to rely on the Copy and Paste functions in my script to copy the field values over. Plus, Is the if statement of if

enough to filter the only records I want into the Order_Item_Database? Because that should do it, but it doesn't. Is it my scripting expertise or am I forgetting something?

Thanxs, and hope that makes sense, again wink.gif" border="0

Cheers

Steve Griff

I guess I'm a little confused about exactly you are doing. If you are copying records by creating new records, why the need to match ID's? If you are copying only data, why copy it, just create a relationship based upon Quote ID and use the related data.

I much prefer the import function to "copy" a set of records from one file to another. I just used this approach to move Invoice Line Items to a Shipper Line Items file. I would also try to avoid the use of copy and paste and use Set Field instead, it sounds like you already have the relationship.

-bd

  • Author

Hi there.

A bit more info...

I have a Quote database that has related to it Quote_Item DB which is then attached to a Product database.

Quote - Quote_Item - Product

If the Quote becomes approved, All the quote items that are related to the Quote by Quote_ID are copied to a Order_Item database which is linked to an Order Database. See what I'm trying to get at? smile.gif" border="0 (I really should tried to have explained it like this the first time).

Basically I want to copy related Quote_Items to Order_Items.

I was wondering what was the best way to get to doing this job. The solution I managed to do did not work so hopefully someone else could explain how to do it for me.

Thanxs

Steve Griff

I was doing this between Invoice Items and Shipper Items yesterday. I would definitely use an import step. You will need to:

1) Isolate the Quote Items in a found set (you can use a "Go to Related Record" from the Quote file)

2) Create a new order and capture the key field used to connect Orders to Order Items.

3) Import the Quote Items to the Order Items file

4) Replace the Key field in the Order Items imported records with the key field you caputured from the new Order you created. This will connect the Order with the import Order Items.

-bd

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.