Hi Everyone,
I would love some help with the logic on how to accomplish sending SMS/Email to many users selected in a report, then using a custom action to invoke a function. Here is what I have:
My Report:
As you can see I have many "Users" (Email, phone etc.) for each row. When I create the custom action I cannot pass the ID of the user, instead I am limited to only pass the ID of the "Delivery Location".
Question #1:
How do I create a "for each" loop that gets the ID's of the users after passing the ID of the Delivery Location?
Sending an SMS/EMail:
I am familiar with sending SMS/Email via deluge and I have done it sucessfully when I am sending one at a time. But I am using the OpenURL code to popup a text box where I enter the test I want to send as SMS. How do I do this so that I can send the same email/text to every person that is selected? Here is my current code...
- void SMS.sendsms(Setup_Customer_Contacts VCustomer)
- {
- querystring = "";
- for each cust in VCustomer
- {
- querystring = querystring + "custID=" + cust.ID + "&";
- }
- openUrl("#Form:SMS_Content?" + querystring, "popup window", "height=400,width=400");
- }
Then the code on the popup window is:
- l = input.custID;
- for each cust in l
- {
- VCust = Setup_Customer_Contacts [ID == cust];
- if ((VCust.Active = "Yes") && VCust.Method.contains("Text"))
- {
- CustomerSMS = twilio.sms.send("Desert_Fuels_SMS", VCust.Phone.toString(), input.smsbody);
- }
- openUrl("#Script:dialog.close", "same window");
- }
This works great to send one person one text. But I can't seem to get it to work to send the same text to many Contacts/users.
Question #2:
How do I modify the code so that it can work to send to multiple users?
Any help on this would be GREATLY appreciated. I'm stuck :(