amypaulsmom Posted March 4, 2002 Posted March 4, 2002 Morning all - I have a script that is not looping correctly. I don't want to have to type it all in - so I will attempt to tell you what it does. I am finding finance charges on payment plan invoices that need to be posted. The first part of the script turns error capture on and then preforms a find using set fields. Now if the Find finds nothing I tell it to exit script. That's probably my first mistake - so do I need to create a loop for the find? After the Find I have it go to the first found record and pull the needed information out of it and then it goes and creates a new invoice for the finance charge. This works find. But this is all in a loop and right before the Next Record step - I have it preforming the sub-script to go and do the invoice (which is in a different database.) If I take the subscript out - the script runs fine and does its Find and marks the records accordingly. But as soon as I add the sub-script step - it just does the first record and then exits the script. Any ideas? Thanks for the help - I am heading back to bed sick - but will check back later this afternoon.
andygaunt Posted March 4, 2002 Posted March 4, 2002 without knowing what the subscript actually does, it is difficult to give you an answer. A subscript should not be a problem in a loop. You don't have a halt script step in there do you?
Fitch Posted March 4, 2002 Posted March 4, 2002 You don't have to type in the whole script for us, but can you outline it a little more? Especially any statements that have to do with starting and stopping and loops and IF. E.g. is this it so far... Loop ..Error Capture ..{do Find} ..If {nothing found} ....Exit Script ..End If .."pull the needed information" ? ------- Perform Script(External, Invoices) ..New Record ------- .."marks the records" ? End Loop Is it something to do with looping back to the Find after you've marked the records? A good way to troubleshoot this is to insert Pause Script steps all over the place. Then print the scipt(s) out so you can check off each Pause as you go through, and once you've nailed it down, take out the Pauses.
amypaulsmom Posted March 4, 2002 Author Posted March 4, 2002 Thanks - I will try give more detail tomorrow. My temp is up to 102 and I have the wonderful aches and pains of the flu.
amypaulsmom Posted March 5, 2002 Author Posted March 5, 2002 Hey - thanks - I needed that laugh. Feeling better today. Still a little achey and dizzy, but at least my temperature is leveling out. I am going to try a different solution - if it doesn't work - I will get back to you all.
Keith M. Davie Posted March 5, 2002 Posted March 5, 2002 "I have it preforming the sub-script to go and do the invoice (which is in a different database.) If I take the subscript out - the script runs fine and does its Find and marks the records accordingly." When your subscript has "done the invoice" is it then returned to the original script so that it may continue?
Recommended Posts
This topic is 8303 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now