Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Please help a dyslexic with this issue:

Problem - I have three tables, email table, leads table and leads newsletter table. The leads table is a portal in the email table. The script action is to go to the first row of the leads portal and send an email, than go to the leads newsletter table and create a record, than return to the leads table and go to the next row and repeat the process.

I have been able to have it all work except the last record in the row is not being acted on. The only way I have been able to make it work is to create a dummy record in the leads table with the highest id number so it is the last record in the portal row. Not the most elegant of solutions.

Here is the script:

Set Field [ Mass Mail::portal_count_g; 1 ]

Loop

Go to Portal Row [ Mass Mail::portal_count_g ]

Set Field [ leads_find_2::row_number; Mass Mail::portal_count_g ]

Set Field [ Mass Mail::ID_g; leads_find_2::id ]

Set Field [ Mass Mail::portal_count_g; leads_find_2::row_number ]

Set Field [ leads_find_2::newsletter; Mass Mail::Newsletter title ]

Set Field [ Settings::Results; Settings::Results & "¶¶" &

Set Field [ leads_find_2::Results; SMTPit_Send & "¶" &

Set Field [ Mass Mail::portal_count_g; leads_find_2::row_number + 1 ]

Perform Script [ "New Record Leads Newsletter" ](this is where the new record in the leads newsletter table is created)

Exit Loop If [ leads_find_2::count_dr= Mass Mail::portal_count_g ]

End Loop

Thanks in advance for your help - Sam

Posted

Set Field [ Mass Mail::portal_count_g; leads_find_2::row_number + 1 ]

Perform Script [ "New Record Leads Newsletter" ](this is where the new record in the leads newsletter table is created)

Exit Loop If [ leads_find_2::count_dr= Mass Mail::portal_count_g ]

It looks like your Exit If is set to exit the loop before the last row. Try putting the Set Field [ Mass Mail::portal_count_g; leads_find_2::row_number + 1 ] step after the Exit If.

Posted

Hi Sam

I would approach this in a slightly different way.

My script would go something like this:

Go to portal row last

Set Field [counter; Get(PortalRowNumber) ]

Go to Portal row first

Loop

do whatever you want

go to portal row next

setfield(counter;counter-1)

exit loop if counter=0

endloop

That way the counter will be set to the number of rows on the portal and your loop will only exit once you have dealt with the last row

HTH

Phil

This topic is 6507 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.