Marmot Posted February 19, 2005 Share Posted February 19, 2005 I have a layout in TableA. It has two fields into which I put info from two other related tables, (Table1, Table2). The related field is job_ID. I have two scripts to get info from T1 and T2 which are basically the same. The outline of the scripts is: set field (TabA_global; TabA_field) go to T1 or T2 layout enter find mode set field (T1 or T2 field; TabA_global) perform find set field (T1 or T2 global: find result) go to TableA layout set field (TabA_field; T1 or T2 global) Is there a way of getting the Table 1 and Table 2 field info at the same time ? At the moment, I have to run the Table1 version of this script, then the Table2 version one after the other. They both work, but this process seems to me cumbersome. This must be true since the find info from TableA for T1 and T2 is the same! Marmot Link to comment Share on other sites More sharing options...
Leader Posted February 20, 2005 Share Posted February 20, 2005 If you don't mind, before we hack scripts, have you considered using calc fields? In other words, it appears your central database has some kind of key into the other 2 tables, so why not define a relationship and then either use AutoEnter or calc fields to access the tables? Link to comment Share on other sites More sharing options...
Marmot Posted February 20, 2005 Author Share Posted February 20, 2005 I'll try it, but surely calculation fields won't deliver static info. marmot Link to comment Share on other sites More sharing options...
bikergeek Posted February 20, 2005 Share Posted February 20, 2005 An auto-enter calc for a static text field can deliver static info after a specified date. Use the evaluate function, with the first parameter being an if statement comparing the current date to a deadline date field with the default return being the current content of the field. Link to comment Share on other sites More sharing options...
philo Posted February 21, 2005 Share Posted February 21, 2005 I don't really understand what you're trying to do, but this looks a lot like a job for a script parameter. If your related tables show up in a portal, you can put a button in the portal row, and make the script parameter the field of that row, then, in the script, you just use the Get(ScriptParameter) function, then you don't need that global field... not sure if this helps... philo Link to comment Share on other sites More sharing options...
Marmot Posted February 21, 2005 Author Share Posted February 21, 2005 [ QUOTE ] An auto-enter calc for a static text field can deliver static info after a specified date. Use the evaluate function, with the first parameter being an if statement comparing the current date to a deadline date field with the default return being the current content of the field. [/ QUOTE ] I understand this. Thank you. I will now try and script it. I see from other correspondence in the forum that folk use the Case function. Case(test1;result1{;test2;result2;defaultResult...}) Presumably it supplies a default value as well. Marmot Link to comment Share on other sites More sharing options...
Leader Posted February 25, 2005 Share Posted February 25, 2005 Well, YOU supply the default value. Think of CASE as a multi-tier IF statement. It does not displace any of the suggestions made here. Building upon Biker's suggestion, you might have a situation in which you wish to use CASE instead of IF if you had a complex decision to make. Link to comment Share on other sites More sharing options...
Marmot Posted February 26, 2005 Author Share Posted February 26, 2005 [ QUOTE ] If your related tables show up in a portal, you can put a button in the portal row, and make the script parameter the field of that row, then, in the script, you just use the Get(ScriptParameter) function, then you don't need that global field... [/ QUOTE ] does the cursor have to be in that field (the one which will be the parameter for the script - a find parameter for example ) when clicking the button...? marmot (whistling furiously) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.