Jump to content

Script only adding to first record in found set


Recommended Posts

Hi,

I have a script that sends an email to the current found set of contacts, each contact has a relationship to the company.

When I perform the script it also adds an interaction to the Company interaction related to that contact.

But even though the correct emails are being sent, it is only adding the interaction to the company of first contact in the found set it is emailing, and not the rest.

I have attached pic of the last bit of the script that does the interaction part

 

 

Screenshot 2020-10-29 at 14.23.42.png

Link to post
Share on other sites

 

12 minutes ago, comment said:

Well, do some debugging and check what is in the $memberID_list variable at each step.

 

I have just enabled the advanced tools, so will have a look at debugging. thanks

 

4 minutes ago, Bertie said:

"MEMBER::zz_Listof_ID" isn't a repeating field is it?

 

Not sure, see pic of the field data

Screenshot 2020-10-29 at 15.46.41.png

Link to post
Share on other sites
17 hours ago, comment said:

Well, do some debugging and check what is in the $memberID_list variable at each step.

 

OK the $memberID_list variable only ever contains a single number, I assume it should have a list?

There are 4 records in the found set

 

Screenshot 2020-10-30 at 09.17.48.png

Screenshot 2020-10-30 at 09.16.23.png

Edited by Chrism
Link to post
Share on other sites
11 minutes ago, Chrism said:

the $memberID_list variable only ever contains a single number, I assume it should have a list?

Yes, it should - provided you are on a layout of the MEMBER table and you have a found set of more than one record when you populate the variable.

 

Link to post
Share on other sites
2 minutes ago, comment said:

Yes, it should - provided you are on a layout of the MEMBER table and you have a found set of more than one record when you populate the variable.

 

Ah ok maybe that's where my problem is, I am not in the layout of the MEMBER table, I am in the TRAINING table. The TRAINING table as a relationship to CONTACTS table, and the CONTACTS table as relationship to the MEMBER table.

The found set is In the TRAINING table, this pulls data from the CONTACTS table (email address, name), the script then emails the found set of email addresses.

Link to post
Share on other sites

A summary field defined in a related table will return the aggregate of the related set. if you are not on a layout of the MEMBER table, then you are setting the variable to the ID of the member that is related to the current record.

Either define the summary field in the TRAINING table or do GTRR [ Match all records in the current found set ] to move your found set to the  MEMBER table.

 

Link to post
Share on other sites

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
  • Who Viewed the Topic

    1 member has viewed this topic:
    mr_vodka 
×
×
  • Create New...

Important Information

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