Newbies PersonasBinar Posted July 6, 2006 Newbies Posted July 6, 2006 (edited) It's been awhile since I've been coding in FM so please bear with me. We're heading over to FM8 advanced and the final DBs will be served. Problem: I've been given a spreadsheet with hard and software purchases for our dept. I've created an inventory DB with hard, soft, location, and machine names tables, as well as a table that is a straight import from the spreadsheet. All I'm trying to do through Scriptmaker, is have a hardware and a software button in the imported inventory layout that will, on a record by record basis clicked by me, add a record to either the soft or hardware table, copy the field data to pertinent fields and then omit the record from the inventory as it will be extraneous. Ultimately all data will either be in hardware or software table and the inventory will be deleted. Once I finish this I will then build the final search and management layouts for ultimate final intranet serving. I can get the records added but for the life of me I can't get the data into the fields. I'm trying to use the Set Field, but I'm missing something here. I imagine it's something really basic as it's been awhile. I have all my data in the one DB, several tables therein and relationships abound between all tables. Any takers? Edited July 6, 2006 by Guest
Tim W Posted July 6, 2006 Posted July 6, 2006 (edited) Hi, A little more information about your spreadsheet table fields might be helpfull. Will you be performing this job once or routinely? Do you have a field in the table(imported from the spreadsheet) which designates hardware or software? If so, you could do a find for hardware only, switch to the hardware layout and import the records into the hardware table. Repeat this process for software, compare total hardware and software record count with the imported table to verify all records were moved to one or the other table. Then delete the imported table. Structure is another consideration, you could use this joint table with a type code (H-hardware, S-software)and not split the table. Is your reason for splitting the table best in your case? If this is a repeating routine, splitting the table will carry, possibly, an undue complexity. Awaiting your reply, Tim Edited July 6, 2006 by Guest
Newbies PersonasBinar Posted July 6, 2006 Author Newbies Posted July 6, 2006 (edited) The inventory in it's entirety is from purchasing. There is no h/s field. I do want to separate the hard from the soft, as the hardware becomes a work station and the software is installed on the hardware so for my purposes separating is best. There are two sets of needs regarding the administration of the Hard and the soft in regards to site licensing, multiple user licenses, updates upgrades etc etc. This splitting is a one time only transaction as further purchases will be input to the final system (online) I've got roughly 2100 records to process. The data I am dealing with is a hodge-podge of stuff, a real mess. For this portion of the project I am the sole user. Once final it will be served up over our intranet and used by management, IT, and purchasing For example in the inventory I have a part description "DELL optiplex20 512 meg 40gig". All I want is to copy this field's data from one table to another field in another table. I think I've created good relationships as they do appear when I try to scriptmaker the Set Field command. I 've been looking at some of the scripting here on the site and I can see. Set Field [hw::gear ; inventory::part description] However whenever I get into scriptmaker I can't seem to hand code the Set Field command. It's always asking me to specify a target field and create a calculation, even though the result is text. Hell it's all text. I'm baffled and I'm certain there is something dead simple I'm either not doing or it's something I've done wrong. I suppose I could go and create an H/s field manually go through all the records adding the value, import that into each respective tables and then clean each tables records manually. If I can I'd rather just click a hardware button, populate a record in the hardware table and clean it while I'm there, thus processing each record only once. Edited July 6, 2006 by Guest
Tim W Posted July 6, 2006 Posted July 6, 2006 Hi, The script to perform your function fails because the child file has no record to set the value in. The following is from my test file: (attached) Set Variable [$Desc; Value:master::Description] Set Variable [$Type; Value:Get(ScriptParameter)] Go To Layout [$Type] New Record/Request If [$Type = "hard"] Set Field [hard:description; $Desc] else Set Field [soft:description; $Desc] End If Go To Layout ["master"(master)] Delete Record/Request I used one script and sent the value parameter equal to the layout name, this navigates to the correct layout and evaluates with the if conditions to update the correct table. Hope this is what you require. Tim asamp.zip
Newbies PersonasBinar Posted July 6, 2006 Author Newbies Posted July 6, 2006 Thanks much ..... I will give this a much better going over in the morning. I was adding a record though, that part was working. It would even omit my record at the end of my script..... Getting back into the coding.... I'm liking 8 so far though. Thanks again Tim, have a great evening. Andrew
Recommended Posts
This topic is 6717 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