Islandtraveler Posted April 4, 2007 Posted April 4, 2007 I am trying to do a script that will duplicate a record and keep some fields but empty others for new data, my problem is that the Replace Field Contents option then replaces the fields in the original record too?? Is there a way to do this? Help!!
mr_vodka Posted April 4, 2007 Posted April 4, 2007 If you set the auto-entry option of "Value from last visited record" for the fields that you want to keep the data the same for, then when you duplicate the record, it will carry over the value.
Islandtraveler Posted April 4, 2007 Author Posted April 4, 2007 Thanks, but I don't always want a new records to show the last viewed information... Wouldn't it then even if I say New Record (starting from scratch or other user) get whatever was looked at before instead of a clean layout with blank fields? Thanks Jim
Islandtraveler Posted April 4, 2007 Author Posted April 4, 2007 Got it... I use the "Set Field" command instead and it does what I was looking for... Only replaces the info in the new record!!! Yeah Thanks All!
mr_vodka Posted April 4, 2007 Posted April 4, 2007 You could always set variables to the field values of those you want to carry the data over. Set Variable [ $field1; Name ] Then in your autoentry option, use a calculated result of the variable. $field1
sbg2 Posted April 4, 2007 Posted April 4, 2007 Theres also the old standby using a script parameter to pass all the values at once. http://fmforums.com/forum/showpost.php?post/172406/
Søren Dyhr Posted April 5, 2007 Posted April 5, 2007 Well... I feel the use of globals whatever should be restrained, and replaced by more object'ish methods.... Here a CF that only works if a certain script is running - Case(0;0) is fieldtype independent. --sd DuplicateSomeFields.zip
sbg2 Posted April 6, 2007 Posted April 6, 2007 Some of us can't create custom functions. Can the same process be done without a custom function? In my file, A global field is not neccesary as the value it contains could be passed as a script parameter. However, It does make it easier to visualize the process. I tend to like having a script for the process. For me it's easier to add to and track down problems that might occur, YMMV.
Søren Dyhr Posted April 6, 2007 Posted April 6, 2007 Yes, since it isn't recursive - could it be done without: Case ( Get ( ScriptName )=_scriptName;Case(0;0);_fieldName) ...if you in each autoenter hardwire the right content. The first is the name of the script where the duped data should be overwritten with void a.k.a Case(0;0) which deals whith all field types container, time or date you name it. --sd
Recommended Posts
This topic is 6781 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