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.

Insert related new records

Featured Replies

  • Newbies

Hi to all

I am designing order database. ORDR file have relationship(ORDR_ID) with ORD_Details file. How to implement things below using scripts:

1)When insert new record in ORDR insert related new records in ORD_Details with default items(from PRDCT file)

2)When changing ORDR_ID in field in ORDR file change ORDR_ID in field in ORDR_Details file

3)Change fields in the non matching records in ORDR_Details file

Thks

quote:

Originally posted by Bayarpurev:

Hi to all

I am designing order database. ORDR file have relationship(ORDR_ID) with ORD_Details file. How to implement things below using scripts:

1)When insert new record in ORDR insert related new records in ORD_Details with default items(from PRDCT file)

2)When changing ORDR_ID in field in ORDR file change ORDR_ID in field in ORDR_Details file

3)Change fields in the non matching records in ORDR_Details file

I would need more details on questions 1 and 3 to answer them. More expanation of what you are trying to do.

To answer question 2, do NOT change ORDR_ID, ever! If you want to give the user an Order Number, then do so. But NEVER give the user access to the underlying IDs. This way they will never change. The Order Number can be changed, but none of your relationships will be broken.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

  • Author
  • Newbies

quote:

Originally posted by captkurt:

I would need more details on questions 1 and 3 to answer them. More expanation of what you are trying to do.

To answer question 2, do NOT change ORDR_ID, ever! If you want to give the user an Order Number, then do so. But NEVER give the user access to the underlying IDs. This way they will never change. The Order Number can be changed, but none of your relationships will be broken.


1)My ORDR database have OrdNumber field which related to OrdNumber field of ORDdetails database(one to many relation) which have also PRTD, UnitPrice and Price fields. When insert new record in ORDR database I would like to insert new records in ORDdetails database with all the default PRTD from Product database. and when user enter OrdNumber in ORDR database it will automaticly change OrdNumber of these new records in ORDdetails database. in other word I should run a script after entering data in new OrdNumber of ORDR database which will change new OrdNumber fields of ORDR database with the same data.

2)when I use import records script in ORDdetail dabase in order to add new records with default PRDT it deletes my previous records. Why?

Thanks

[This message has been edited by Bayarpurev (edited November 13, 2000).]

quote:

Originally posted by Bayarpurev:

1)My ORDR database have OrdNumber field which related to OrdNumber field of ORDdetails database(one to many relation) which have also PRTD, UnitPrice and Price fields. When insert new record in ORDR database I would like to insert new records in ORDdetails database with all the default PRTD from Product database. and when user enter OrdNumber in ORDR database it will automaticly change OrdNumber of these new records in ORDdetails database. in other word I should run a script after entering data in new OrdNumber of ORDR database which will change new OrdNumber fields of ORDR database with the same data.

2)when I use import records script in ORDdetail dabase in order to add new records with default PRDT it deletes my previous records. Why?]

#2: I would be that you had your import set to update existing records rather than create new records. Resetup your import format manually, then store it in the script and you should be OK.

#1: It seems to me that you are kinda doing things backwards. Adding records, then having the user change the data to match you ORDR record.

I would just have the user click a button or something to add records one at a time (or in batches or whatever), after they have correctly setup the ORDR record. Setup these records by running a script in the ORD_Details database or via the relationship. This will corrctly setup your IDs and such.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

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.