Jump to content
Server Maintenance This Week. ×

This topic is 8185 days old. Please don't post here. Open a new topic instead.

Recommended Posts

ok i have this script. it loops through a portal (relationship is based on a date) and send an e-mail for each record in the relationship. the script did not run thursday and friday (this is not the problem, just that we had the days off) well when i went to go back and run it to catch up. it runs the records for friday just fine. It does not send the e-mail for the records on thursday, it does do everything else in the script though. here is the script

If[ NumofPortalRows = 0 ]

Exit Script

End If

Set Field [ gPortalNumber, 1 ]

Loop

If[ PatternCount(hold,Orders_???:Order ID Number) < 1 ]

Go to Portal Row[ gPortalNumber ] [ By Field Value..., Select entire contents ]

Set Field [ hold, hold &Orders_???:Order ID Number& "" ] <- this step is performed

Go to Portal Row[ gPortalNumber ] [ By Field Value..., Select entire contents ]

Send Mail [ To:...] [ No dialog ] <-this step is NOT performed

End If

Exit Loop If[ gPortalNumber = NumofPortalRows ]

Set Field [ gPortalNumber, gPortalNumber + 1 ]

Go to Portal Row[ gPortalNumber ][ By Field Value..., Select entire contents ]

End Loop

Set Field [ gPortalNumber, 0 ]

Perform Script [ "remove double space" ][ Sub-scripts ]

If[ NumofPortalRows <> numoflines ]

Perform Script [ "loop email " ][ Sub-scripts ]

End If

Exit Record/Request

its wierd, at first i thought something was wrong with my if statement. but it performs one of the steps in my if statement, but not the other. I even tried unchecking the "perform without dialog" check box on the mail script, but it doesnt pop up the e-mail at all. its like it just skips that script step. Anyone have any advice as to what the problem may be?

[ November 26, 2001: Message edited by: bman ]

Link to comment
Share on other sites

UPDATE:

I have tried it on another computer, same exact problem. I can't figure out what is different about the records for that date.

one thing i did forget to mention is i get a error saying that there is not enought memory to perform the operation. but just on the ones from that date, all other dates work fine. and the error doesn't occur everytime. maybe 1 out of every 3 or 4 times i try to run it. this is wierd.

Link to comment
Share on other sites

quote:

Originally posted by bman:

If[ NumofPortalRows = 0 ]

Exit Script

End If

Set Field [ gPortalNumber, 1 ]

Loop

If[ PatternCount(hold,Orders_
???
??? Order ID Number) < 1 ]

Go to Portal Row[ gPortalNumber ] [ By Field Value..., Select entire contents ]

Set Field [ hold, hold &Orders_: : Order ID Number& "" ]
<- this step is performed

Go to Portal Row[ gPortalNumber ] [ By Field Value..., Select entire contents ]

Send Mail [ To:...] [ No dialog ]
<-this step is NOT performed

End If

Exit Loop If[ gPortalNumber = NumofPortalRows ]

Set Field [ gPortalNumber, gPortalNumber + 1 ]

Go to Portal Row[ gPortalNumber ][ By Field Value..., Select entire contents ]

End Loop

Set Field [ gPortalNumber, 0 ]

Perform Script [ "remove double space" ][ Sub-scripts ]

If[ NumofPortalRows <> numoflines ]

Perform Script [ "loop email " ][ Sub-scripts ]

End If

Exit Record/Request

This is an incomplete answer, but I think you could simplify your loop by using the following:

Go to Portal Row [First]

Loop

Set Field [Hold]=Hold & "<paragraph symbol>" & Orders_: : Order ID Number

.

. <--whatever else you want to have happen to/with each row

.

Go to Portal Row [Next, Exit After Last]

End Loop

I'd also recommend taking out the [no dialog] in your Send Mail step (or any other script step) until you are sure the script works. Otherwise you're never quite sure what's going on in the background.

[ November 26, 2001: Message edited by: The Bridge ]

Link to comment
Share on other sites

i originally had the loop setup that way. unfortunately it caused more problems then it solved. I forget exactly what problems i had with it, but this is the solution that worked.

anyway, i have narrowed it down to one record. it sends the mail for every record in the relationship but one. and there is nothing drastically different about this record than any other. So the script works fine. it just won't send mail for that one record.

Link to comment
Share on other sites

quote:

Originally posted by bman:

i originally had the loop setup that way. unfortunately it caused more problems then it solved. I forget exactly what problems i had with it, but this is the solution that worked.

Fair enough -- I can't say I haven't done what it takes to get something to work the way I want it. smile.gif" border="0

quote:

anyway, i have narrowed it down to one record. it sends the mail for every record in the relationship but one. and there is nothing drastically different about this record than any other. So the script works fine. it just won't send mail for that one record.

The only thing I can think of here is to double-check the actual data in that record. Perhaps there's a value mistyped, the date is in the wrong format... just a thought.

Link to comment
Share on other sites

i am checking on the data now. What really bugs me, is that it doesnt even try to send the mail. It doesn't even bring up the e-mail when i uncheck "perform without dialog."

It seems to only be happening if i set the "to:" field or the "cc:" field in the e-mail to be set by a field. if i just type in some to use it works fine.. but just for this record. i thought for a minute that it was because this person somehow enter up with a carriage return after her name and i was trying to pull that into the "CC:" field. But even after eradicating the carriage return it still does not function.

Link to comment
Share on other sites

This topic is 8185 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.