JFMiller3 Posted March 21, 2008 Share Posted March 21, 2008 SET CARRIER RATES Freeze Window Set Variable [ $CARRIER NUM; Value:CarrierInfo::CARRIER_NUMBER ] Go to Layout [ “CARRIER FUEL†(CARRIER FUEL) ] New Record/Request Set Field [ CARRIER FUEL::ID NUMBER; 1 ] Set Field [ CARRIER FUEL::CARRIER NUMBER; $CARRIER NUM ] Go to Record/Request/Page [ Next ] Set Variable [ $ID; Value:CARRIER FUEL::ID NUMBER ] Loop If [ CARRIER FUEL::ID NUMBER New Record/Request Set Field [ CARRIER FUEL::ID NUMBER; $ID + 1 ] Set Field [ CARRIER FUEL::CARRIER NUMBER; $CARRIER NUM ] Set Variable [ $ID; Value:CARRIER FUEL::ID NUMBER ] Go to Record/Request/Page [ Next ] Exit Loop If [ CARRIER FUEL::ID NUMBER ≥ 8851 ] End If End Loop Go to Layout [ original layout ] I have this script that loops to build a rate table for a carrier. I have the fuel cost table related to the carrier fuel table by the ID number (line). line 1 = 1.15 intervals = .001 line 8851 = 10 My next script more more efficiently. It assigns FSC cent per mile with globals and variables. I want to see if any one has an idea to speed this process up. It works....but I would like it to move faster. If it can't, I will just add "allow user to abort -off" Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted March 21, 2008 Share Posted March 21, 2008 I'm not sure I'm comprehending the purpose here. Every parent record you do this on is going to have 8851 child records after this script is finished, and you have end users who will be actually running this script, and the 8851 child records are for .... what, exactly? Quote Link to comment Share on other sites More sharing options...
Weetbicks Posted March 22, 2008 Share Posted March 22, 2008 I understand the basic gist to be: Grab a Carrier ID Create 8851 Carrier Fuel records, and set the Carrier ID into each. Importing records into a table is faster than looping to create records. One technique you could use to create the 8851 records is create a field with 8851 repetitions. First create another field it can be global, instead of setting Carrier ID into a variable, set it into this global field. Now in the 8851 repetition calc set its calculation to the global field. Every single repetition (8851) will contain the Carrier ID. Now all you need to do is do an import from the table with the 8851 repetition field to your Carrier Fuel table. In the import script make sure when prompted to split repetition fields into separate records. What this will do is import 8851 records into carrier fuel, and each will contain the Carrier ID. From there you can use replace field contents to set values into other fields on carrier fuel records. Quote Link to comment Share on other sites More sharing options...
Weetbicks Posted March 22, 2008 Share Posted March 22, 2008 line 1 = 1.15 intervals = .001 line 8851 = 10 as far as setting the one above, turn this into another repeating field of 8851, the calculation will use the Get ( CalculationRepetitionNumber ) and would be something like 1.15 + ( Get ( CalculationRepetitionNumber ) * 0.001 ) import this as well. Alternatively this calc could probably be an auto-enter calc or a calc on the Carrier Fuel table itself, it can use either Get ( RecordNumber ) to get its #, or its serial number etc. Quote Link to comment Share on other sites More sharing options...
JFMiller3 Posted March 24, 2008 Author Share Posted March 24, 2008 Thanks Weetbix, I integrated your ideas into the script. I noticed a sizeable decrease in processing. 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.