hairyjim Posted July 24, 2001 Posted July 24, 2001 How do you duplicate a record and also the data in the portal? I have two DB's, one called Quote Builder and another (which servers the portal) called Quote items. How do I do this, I cannot figure out what script steps to use....
LiveOak Posted July 24, 2001 Posted July 24, 2001 It's not so much a what as a where. The "what" is just the script step Duplicate Record/Request. A script must be run in the Quote Items file to do this. You must also make sure that the script duplicates the index that connects the record in Quote Items to the correct record in Quote Builder. The script can be triggered by a button in the portal row, this will automatically select which portal row you wish to duplicate. The scripts might look like: In Quote Builder: Allow User About (off) Set Error Capture (on) Go to Related Record (Quote Items) Go to field() <--- this or some step necessary to force return to Quote Builder In Quote Items: Allow User About (off) Set Error Capture (on) Duplicate Record/Request Set Field(:, "") <--- clear any fields you want blank -bd
hairyjim Posted July 24, 2001 Author Posted July 24, 2001 I think you may have misunderstood. I want to duplicate the record, but every time I duplicate it the portal information is not duplicated! How do I duplicate the whole record and all the information that is being displayed in the portal? Thanks James
Kurt Knippel Posted July 24, 2001 Posted July 24, 2001 quote: Originally posted by hairyjim: How do I duplicate the whole record and all the information that is being displayed in the portal? You need to duplicate both the parent record as well as all the child records in the related file. Remember that the information in the portal is not just part of the master record, they are all records on thier own. They way I do it is to duplicate the master record, then goto the related records, duplicate them via a loop in a script. Finally I go though and update all of the various IDs so that they are correctly related. This all needs to be controlled via scripting and not simply using the Duplicate command.
Chuck Posted July 24, 2001 Posted July 24, 2001 I wrote an FAQ for this topic. Take a look at the following: http://www.fmforums.com/ubb/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=8&t=000016 Chuck
hairyjim Posted July 26, 2001 Author Posted July 26, 2001 Hi Guys, Right I have used this code to duplicate portal records: The first is in the main DB. Enter Browse Mode [] Go to Layout ["Data Entry"] Go to Related Record [show, "Quote Items"] Duplicate Record/Request Copy [select, "Quote Number'] Perform Script [sub-scripts, External: "Remote Quote Items"] Go to Layout And this is in the child DB. Enter Browse Mode [] Go to Layout ["Data Entry"] Sort [Restore, No dialog] Go to Record/Request/Page [First] Loop Duplicate Record/Request Paste [select, "Quote Number"] Go to Record/Request/Page [Exit after last, Next] End Loop The problem is it is not correctly duplicating two fields. Quantity and Section Number. They are set to default values of 1. But a user can change the value from 1 to 2, or 3 etc. But obviously when it comes to duplicating the record it defaults the value back to 1. Does anyone know a way around this. I need to keep the default value in, otherwise if a user 'adds' a new item to the invoice it will not include the price! Please...please help. I am going in circles with this one and it is driving me back to smoking again..... James
Recommended Posts
This topic is 8522 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 accountSign in
Already have an account? Sign in here.
Sign In Now