A follow up to this is that will will have hundred of campaigns and a check box filed is restricted to not allowing scrolling in it's display so I would need an infinite page length to view all the campaigns at once.
Sorry for all the after thoughts. I am going crazy trying to figure this out... for the portal I created a many to many relationship which in theory works well but again adding multiple contacts to the same (current) campaign in one swoop is difficult.
I see no reason why updating the value list will have any effect on the values stored in the fields of existing records. And I do not see how clicking a check box in this field will "wipes out the previously checked campaign names." Perhaps you are using either Replace Field Contents or Set Field in a script to add a selected value to a check box field?
Is this the basic scenario?
You perform a find for a set of emails and then "flag" them to make them all members of a new email campaign?
It IS possible to use check boxes for that, but you have to do it in a way that doesn't overwrite existing data in the field.
Say your field is named YourTable::YourCheckBoxField. the following expression used as the second parameter of a set field step or a replace field contents operation (using the calculation option) will preserve existing data in the field by appending new data to the field:
If ( IsEmpty ( FilterValues ( YourTable::YourCheckBoxField ; "NewValueHere" ) ) ;
List ( YourTable::YourCheckBoxField ; "NewValueHere" ) ;
The If function ensures that you can't accidentally add the same exact value to the field more than once. (Check box fields store their selected values as a list of values separated by a return so using the List function like this appends a new value to that list without altering existing data.)
But personally, I'd set up a join table linking a Table of "campaign" records to the table of Email addresses and manage this as the many to many relationship that it is. Using a Join table is a more flexible way to manage many to many relationships. You can use a looping script to loop through your found set and create one new record in the join table for each record as a way to select each record in the found set to "flag" it for the new campaign.
Thanks for your prompt reply. and thanks for the above suggestion... I agree the related table is the way to go and as just mentioned I tried a many to many relationship and (sorry for my lack of expertise) but I am having trouble conceptualizing the process to "add a campaign to the contact record" with one easy button (probably a script I can;t quite figure out yet)
Here is the simple many to many relationship I created.
Adding a contact to a selected campaign is a matter of creating a new record in Campaigns Link with the needed ID's to link it to the specified campaign record and the current contact record.
The easiest way to do that is to set up a portal to Campaigns Link on your T05_Contacts layout. Format ID_Campaign with a "use values from field" value list where field 1 is the values of Con_Email_Campaign::ID and Field 2 is campaign name. This value list allows you to select a campaign by name, but enters the appropriate ID.
But there are scripted methods that would also allow you to find multiple contact records select a campaign record once and then the script loops through the contacts creating one new join table record for each.
Thanks for this answer. I learn something from you each message. I will attempt the script and probably come back to you for help... Thanks PhilModJunk.