Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Trying to speed up this script


JFMiller3

Recommended Posts

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"

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use