BH8269 Posted October 29, 2007 Share Posted October 29, 2007 I have a commissioning DB.. It maybe that in it's lifetime a unit in this DB has a fault & has to be re-commissioned.. What I am after doing is to have a button that says RE-COMMISSION this will duplicate the current record, the field IMEI_No value needs to be prefixed in the original record with an X X350389830000000 and this is then the old record the duplicated record IMEI_No field would then equal 350389830000000 will then become the current record. Many thanks, Bru. Quote Link to comment Share on other sites More sharing options...
efen Posted October 29, 2007 Share Posted October 29, 2007 Something along the lines of: 1 marking the current record with a "1" in a particular/dedicated field 2 setting a global field with the ID number of the record 3 duplicating the record ( i.e the new record) 4 finding the old record with the mark added in step 1 5 replacing the old ID number with a set field calculation of "X" & the ID number from the global in step 2 Quote Link to comment Share on other sites More sharing options...
David Head Posted October 30, 2007 Share Posted October 30, 2007 This script will work: Set Field [ Table::IMEI_No; "X" & Table::IMEI_No ] Duplicate Record/Request Set Field [ Table::IMEI_No; Right ( Table::IMEI_No; Length(Table::IMEI_No) - 1 ) ] Note to efen: be very careful with marking records in a multi-user system. What would happen if two people marked records at the same time? What's more, you need to unmark that record after the replacement. Anyway, you should be able to see from the above that marking the record is unnecessary. Quote Link to comment Share on other sites More sharing options...
BH8269 Posted October 30, 2007 Author Share Posted October 30, 2007 This script will work: Set Field [ Table::IMEI_No; "X" & Table::IMEI_No ] Duplicate Record/Request Set Field [ Table::IMEI_No; Right ( Table::IMEI_No; Length(Table::IMEI_No) - 1 ) ] Hi David, Is this code for FP6? Regards, Bru. Quote Link to comment Share on other sites More sharing options...
BH8269 Posted October 30, 2007 Author Share Posted October 30, 2007 I seem to think that the semicolons should be commas for FP6, please excuse my ignorance on this from a newbie but what is the table:: defining? I really want to understand & get to grips with the scripts could you please explain a little more? Thank you, B. Quote Link to comment Share on other sites More sharing options...
David Head Posted October 30, 2007 Share Posted October 30, 2007 Sorry, the principle works in FP6 but the script needs to be modified. Use commas for argument separators and you don't specify table names: Set Field [ "IMEI_No", ""X" & IMEI_No" ] Duplicate Record/Request Set Field [ "IMEI_No", "Right ( IMEI_No, Length(IMEI_No) - 1 )" ] Above is how the script will appear in ScriptMaker. Quote Link to comment Share on other sites More sharing options...
BH8269 Posted October 31, 2007 Author Share Posted October 31, 2007 Hi David, This still isn't working smiley-cry Bru. Quote Link to comment Share on other sites More sharing options...
David Head Posted October 31, 2007 Share Posted October 31, 2007 Please have a look at the online help topic for how to use the Set Field script step. There are two options: 1. Specify target field - this is where you would select the IMEI_No field 2. Calculated result - this is where you would enter "X" & IMEI_No As I said in my post - "Above is how the script will appear in ScriptMaker." Hope that helps but please read the help file too. Quote Link to comment Share on other sites More sharing options...
BH8269 Posted November 5, 2007 Author Share Posted November 5, 2007 Hi David, I now have FP9 & it worked fine in that many thanks... Bru Cheers! Quote Link to comment Share on other sites More sharing options...
BH8269 Posted November 26, 2007 Author Share Posted November 26, 2007 David, Would it be possible to change the text colour on the IMEI_No X'ed out record to red as part of this script? Regards, Bruce. Quote Link to comment Share on other sites More sharing options...
BH8269 Posted November 28, 2007 Author Share Posted November 28, 2007 Anyone?? I found the TextColour RGB (255,0,0) But not sure how to work it into ""X" & IMEI_No" Thanks, Bru. Quote Link to comment Share on other sites More sharing options...
BH8269 Posted December 3, 2007 Author Share Posted December 3, 2007 Sorted it.. Thanks anyway! B smiley-wink Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.