Jump to content

Copy one line item record to another line item record


This topic is 8159 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi people

Another question

I have a line item database that is currently in "show only related records" type mode. But the thing I want to do now is to "duplicate" those line items into another line items database using a script. (I want the script to be automatic non-interactive).

Let me describe the scenario. I have two databases. One Quote database and another Order database. Each database has a "line item" database. What I want to do is when a Quote "is accepted", information of the Quote record needs to be copied into the Order database.

Below is the field Names of the databases: -

Quote Database

Quote_ID (Needs to be exported to Order Database)

Customer ID (Needs to be exported to Order Database)

Quote Line Item Database

Product_ID (Needs to be exported to Order Line Item Database)

Quantity (Needs to be exported to Order Line Item Database)

Order Database

Order_ID (autoincrement primary key)

Customer_ID (From Quote Database)

Quote_ID (From Quote Database for reference)

Order Line Item Database

Order_ID (From Order_Database to establish relationship)

Product_ID (From Quote Line Item Database)

Quantity (From Quote Line Item Database)

This sounds really tricky and messy. Any ideas? (Ideally a script to show how to do this)

Any help will be most welcome,

thanxs, Steve Griff.

Link to comment
Share on other sites

Depending upon how many records you want to copy and how many fields in a record, you can use one of a couple of methods:

1) Export to a Tab Text file from your first file and import from the Tab Text file to your second file.

2) Create a "Constant" relationship between the two files. In each file create a field:

One (calculation, number, indexed) = 1

And create a relationship matching these fields. Now you can access GLOBAL field from one file in the other.

Depending upon how much scripting you want to do, you can use one or more global fields to copy the data from one file to another. I'd probably use one global field for each field to be copies and do it one record's worth at a time.

-bd

Link to comment
Share on other sites

Steve,

the best will be to leave the line and just change the attribute. I am using one single database with "line" which is just "traveling" through ordering system.

Workflow is:

Sales create new quotation. This "Line" database is holding all items from new quotation. It can be unlimited number of items.

Then sales people create order from this. Quotation changes status as "order", that is set also in "lines".

Then "lines" are checked for stock level.

"Lines" are calculated for order from suppliers, if quantity is not sufficient.

Then "lines" are shown in factory for warehouse and warehouse is allocating enough products for further printing of logos on products.

Then still the same "lines" shows in workshop for workers to print on products.

Finally invoice and packing list is produced from "lines"

Simple, isn't it?

Link to comment
Share on other sites

This topic is 8159 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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