3 Replies Latest reply on Sep 30, 2016 8:30 AM by philmodjunk

    Email malinglist variable

    cillion

      Hi!

      Am making a pop up layout window where I let the user make a mailinglist of the selected peoples. Meaning that I have a portal with all the people and an checkbox where the user check if the email should be included in the mailinglist or not. The mailinglist is one varible that should be rewrited intill the user is pressing send button, then the completed mailinglist should be properly formatted for the Outlook recipient field.

       

      The problem is that I dont seem to find a solution for these actions:

      - include the email to the mailinglist variable if it is checked and the mailinglist is not empty

      - and removing the email from the mailinglist variable if it unchecked and the mailing is not empty

       

      This are my onObjectModify-script on the checkbox in the portal at theese point:

       

      Hopefully somebody have some tips on this ?

        • 1. Re: Email malinglist variable
          philmodjunk

          That script really doesn't make sense to me. Either the user is clicking an "empty" looking check box to add the recipient to the list or they are clicking a "selected" looking check box to remove it. There is no need for an actual field in the recipient record, just a button and your global variable with it's list of selected recipients.

           

          I'm going to use my own English language names here to avoid possible confusion on my part as to which field is which in your solution. I am assuming that you have a list of records in either a List view or a Portal with a button on the row for selecting/deselecting that recipient.

           

          If [ IsEmpty ( FilterValues ( Recipients::RecipientEmailAddress ; $$EmailAddressList ) ) // Recipient is not selected ]

             Set Variable [$$EmailAddressList ; Value: List ( $$EmailAddressList ; Recipients::RecipientEmailAddress ) ]

          Else

            #Recipient is selected, remove from list

            Set Variable [$$EmailAddressList ; Value: //See calculation shown below ]

          End If

          Refresh Object ["TickMark"]

           

          //use this calc to remove a recipient from the list

          Let ( [ TheList = ¶ & $$EmailAddressList & ¶ ;

                     TheList = Substitute ( TheList ; ¶ & Recipients::RecipientEmailAddress & ¶ ; ¶ )

                  ] ;

                     Middle ( TheList ; 2 ; Length ( TheList ) - 2 )

                ) // Let

           

          On your layout, you can put either layout text or a graphic image that looks like an 'X' or a "tick mark' and use this expression for a Hide Object When Expression:

          IsEmpty ( FilterValues ( Recipients::RecipientEmailAddress ; $$EmailAddressList ) )

           

          This will make the image or text disappear when the recipient is not in the list and appear when it is. You will also want to select this layout object and use the name box on the Inspector's position tab to name it "TIckmark". That's the purpose of the refresh object script step--to make sure that it appears or disappears as a result of selecting or deselecting a recipient.

          1 of 1 people found this helpful
          • 2. Re: Email malinglist variable
            cillion

            //use this calc to remove a recipient from the list

            Let ( [ TheList = ¶ & $$EmailAddressList & ¶ ;

            TheList = Substitute ( TheList ; ¶ & Recipients::RecipientEmailAddress & ¶ ; ¶ )

            ] ;

            Middle ( TheList ; 2 ; Length ( TheList ) - 2 )

            ) // Let

            So where do we use the the this calculation?

            • 3. Re: Email malinglist variable
              philmodjunk

              Did you see the spot in the script where it says:

               

              //See calculation shown below

               

              ??

               

              That's where this calculation should be placed.