March 16, 201114 yr Hello everyone I'm facing a new challenge. I have 2 FM databases. The first is used by the estimation team and it's all about estimating house construction projects. The second, the Management db, one is used for managing clients, ISO 9001, production etc. and is widely used by the employees. Now I'm working on creating a complete shipping list in the management db and I need to import informations from the estimation db. For example. All the doors and windows and their quantities is in the estimation db. What I need to do is go to the windows and doors Line items layout by using the $$projectID (from the management db) I will need to loop the script to gett al the doors and windows and each time extract 2 fields and put them in the shipping list layout of the management db. I have made tons of scripts of all kind but I really don't know how to deal with moving datas from one database to another. I'm looking for examples of scripts and how to use them. Can I do this with just one script in the management db ? I guess I'm going to use Get (scriptparameter) ... I need some tips, references or examples please. Thank you so much.
March 17, 201114 yr Hello everyone I'm facing a new challenge. I have 2 FM databases. The first is used by the estimation team and it's all about estimating house construction projects. The second, the Management db, one is used for managing clients, ISO 9001, production etc. and is widely used by the employees. Now I'm working on creating a complete shipping list in the management db and I need to import informations from the estimation db. For example. All the doors and windows and their quantities is in the estimation db. What I need to do is go to the windows and doors Line items layout by using the $$projectID (from the management db) I will need to loop the script to gett al the doors and windows and each time extract 2 fields and put them in the shipping list layout of the management db. I have made tons of scripts of all kind but I really don't know how to deal with moving datas from one database to another. I'm looking for examples of scripts and how to use them. Can I do this with just one script in the management db ? I guess I'm going to use Get (scriptparameter) ... I need some tips, references or examples please. Thank you so much. Why don't you simply relate the tables of one file to the other? Scripting Imports then becomes redundant. RW
March 17, 201114 yr Author Why don't you simply relate the tables of one file to the other? Scripting Imports then becomes redundant. RW HELLO ok I Lost a lot of time on this, but yes I related the tables, found out how to use the script parameters to bring back the data I need. For one data it works just fine. Now I'm stuck again (and a bit frustrated). Because I made a script that goes to my window table and tried to make it loop, but for some reason the Go to Record/Request/Page [Exit after last] doesn't work. I have my original window I open the other database, give a new name to this window (LI_PF). I goes to the related record on the right layout. I perform my script, retrieve my data from the first record, put them in the other db then I select the LI_PF window. Look like it comes in front. and the go to next record doesn't work, it seems to work on the original window. and my loop end. In fact I think I just can't go to the LI_PF window... the script always comes back to the original database. Somebody please tell me the right way to do this. here are the scripts: Generer Portes et fenetres Set Window Title [ Current Window; New Title: "LC" ] New Window [ Name: "LC_LI_Item" ] Go to Layout [ “PP_LC_LI_ALL_Chargement” (PP_LC_LI_ALL_Chargement) ] # Select Window [ Name: "LC"; Current file ] # Open File [ “Estimation” ] Set Window Title [ Of Window: "Estimation"; New Title: "LI_PF" ] Go to Related Record [ From table: “LI_PF_Cedule”; External; Using layout: “LI_PF_Cedule” (LI_PF_Cedule) ] [ Show only related records ] Loop Perform Script [ “Constante Portes et fenetres”; Parameter: LI_PF_Cedule::qty & "¶" & LI_PF_Cedule::LC_cDesc ] Select Window [ Name: "LI_PF" ] Go to Record/Request/Page [ Next; Exit after last ] End Loop #
March 17, 201114 yr Author OK I made a test I added a Set Variable[ $$window ; Get (WindowName) ] right after my Select window and it give me the "LI_LC_Item" as a result and I also put it right after the Open FIle "Estimation" and it return "LC" which is the first window open it the first database. So clearly the Select window doesn't work with the second file. WHat am I suppose to do to go back to that window and perform a Loop? Any idea anyone? I'm desperate. ... and I read it was easy to work with multiple databases !!! Pffff!
March 17, 201114 yr Author OK I got it I had to create the complete looping script in the second database and call the rest of it in the first. and all is working real fine. This is the kind of detail that should be in the Help. I read the help, the bible, the forums I don't know how many times. I'm glad it's done but my brain is melting. bye
March 17, 201114 yr ... and I read it was easy to work with multiple databases I am not sure I'd say that - but it can be much easier when you have TOs and layouts for the other file tables in the current file. Which of course brings up the question why use two files to begin with...
June 13, 201114 yr Author I am not sure I'd say that - but it can be much easier when you have TOs and layouts for the other file tables in the current file. Which of course brings up the question why use two files to begin with... An oldie but I can answer. The first db generates houses estimations and it's heavily used buy 3 peoples an it's heavily scripted. the other is for all the employes and it's used more gently... I don't want any database to lag because of the other. Which happen anyway because the ******* server is so slow. ;-) Bye
Create an account or sign in to comment