AnsweredAssumed Answered

looping script taking for ever.

Question asked by jp98 on Jul 21, 2016
Latest reply on Jul 21, 2016 by jp98

Can someone help me optimize a script please.

 

What i have is one table with all products listed in it and another table where quote line items are stored. We have another piece of software that works out what products are required for a job and then generates a report saved as an excel file. I have a vbscript that runs on this file and optimizes it for easy import to filemaker.

 

This file contains product codes, descriptions and quantities but not product categories. However, for the relationship between the earlier mentioned tables to function correctly, i need to get the product category for each product as well. Currently i have a script that loops as below.

 

Step 1. grab product code from first imported product- set variable

Step 2. go to products layout and perform search

Step 3. get product category for that product - set variable

Step 4. return to original layout and set category field for that product.

 

This script can take ages to perform even when there are only 50 lines but sometimes we will have over 200.

 

To distinguish between records that have already been done and ones that haven't, there is a find step which searches for records with no product category set.

Once product category and product code are set, the relationship functions correctly and pulls all other information such as price and default markup etc. across to the quote.

 

Looking forward to whatever you can offer!

Outcomes