How to gather form data into the script of another form
I have created a fee schedule form where I store the values for fees we charge. I also have a form that is used to send a billing notification of fees owed. I am trying to include the fees from the fee schedule form for use in the form that sends the email - I have pasted the script below. The
ExternalFormFullWebFee variable is supposed to be gathering the fee that I want from the external form data. The script does save but when I run the form I get a 'variable cannot be updated' error and the email is never sent. I want to populate the GetWebFeesFull and GetWebFeesBCard variables with data from the Agent_Fee_Schedule form so I don't ever have the numbers hard coded.
I tried running another for each statement first and get the fee data into variables but then I can use the variables from one for each statement in another... What do I do now? Thanks!
- for each UnpaidAgent in Agent_Entry [(((Owe_2011_Websites == "Business Card" || Owe_2011_Websites == "Full") || Owe_2012_Websites == "Business Card") || Owe_2012_Websites == "Full")]
- {
- ExternalFormFullWebFee = Agent_Fee_Schedule[Business_Card_Website != 0].Business_Card_Website;
- GetWebFeesFull = 495;
- GetWebFeesBCard = 35;
- AgentFee = 0;
- PayPlanRemaining = 0;
- PayPlanMsg = "";
- MsgBC2011 = "";
- MsgBC2012 = "";
- MsgF2011 = "";
- MsgF2012 = "";
- if (UnpaidAgent.Owe_2011_Websites == "Business Card")
- {
- AgentFee = (AgentFee + GetWebFeesBCard);
- MsgBC2011 = "Business Card Website for 2011 - Amount DUE: $" + GetWebFeesBCard;
- }
- if (UnpaidAgent.Owe_2011_Websites == "Full")
- {
- AgentFee = (AgentFee + GetWebFeesFull);
- MsgF2011 = "Full website for 2011 - Amount DUE: $" + GetWebFeesFull;
- }
- if (UnpaidAgent.Owe_2012_Websites == "Business Card")
- {
- AgentFee = (AgentFee + GetWebFeesBCard);
- MsgBC2012 = "Business Card Website for 2012 - Amount DUE: $" + GetWebFeesBCard;
- }
- if (UnpaidAgent.Owe_2012_Websites == "Full")
- {
- AgentFee = (AgentFee + GetWebFeesFull);
- MsgF2012 = "Full website for 2012 - Amount DUE: $" + GetWebFeesFull;
- }
- if (UnpaidAgent.Payment_Plan == "Yes")
- {
- PayPlanMsg = "You are currently on a payment plan, please send in your monthly payment per your agreement";
- MonthlyFee = (AgentFee / 12).round(2);
- PayPlanRemaining = (AgentFee - UnpaidAgent.Payment_Plan_Collected);
- if (PayPlanRemaining < MonthlyFee)
- {
- MonthlyFee = PayPlanRemaining;
- }
- sendmail
- (
- To : UnpaidAgent.Company_Email
- From : zoho.adminuserid
- Subject : ("KCRH Payment Plan Reminder")
- Message : UnpaidAgent.FirstName + ",<br />\n<br />\nAccording to our records <strong>you currently owe vendor fees for your website</strong>. These fees will include multiple years due if applicable. The current vendor fee for a business card website is $35/year and $495/year for the full website. To avoid service interruption please remit payment at your next convenience.<br />\n<br />\n" + MsgBC2011 + " " + MsgF2011 + "<br />\n" + MsgBC2012 + " " + MsgF2012 + "<br />\n<br />\n<span style=\"color: rgb(153, 51, 0);\"><strong>" + PayPlanMsg + "</strong></span><br />\nOriginal Fees Due: $" + AgentFee + "<br />\nRemaining Fees Due: $" + PayPlanRemaining + "<br />\n<strong>Minimum Amount Due Now: $" + MonthlyFee + "</strong> (You may prepay if you choose)<strong><br />\n</strong><br />\nPay via PayPal by logging into you PayPal account and send payment to paypal@kcregionalhomes.com. If you don't have a PayPal account you can create one and <strong>send your payments for free online</strong>: <a href=\"https://www.paypal.com/\">Join PayPal</a> - click 'sign up' on the top menu.<br />\n<br />\nYou can also make a check payable to "Kansas City Regional Homes, Inc." and drop it by the office or mail it to:<br />\n<br />\nKansas City Regional Homes, Inc.<br />\nAttn: Accounts Receivables<br />\n12230 W. 135th St.<br />\nOverland Park, KS 66221<br />\n<br />\nThank you,<br />\n<br />\nRonald Byron<br />\nBroker/Owner<br />\nKansas City Regional Homes, Inc.<br />\nCell: 913-579-5118<a class=\"zoho-button\" href=\"javascript:;\">Done</a>"
- )
- }
- else if ((UnpaidAgent.Payment_Plan == "No") || (UnpaidAgent.Payment_Plan == "N/A"))
- {
- sendmail
- (
- To : UnpaidAgent.Company_Email
- From : zoho.adminuserid
- Subject : ("KCRH Payment Reminder: Website Vendor Fees Due")
- Message : UnpaidAgent.FirstName + ",<br />\n<br />\nAccording to our records <strong>you currently owe vendor fees for your website</strong>. These fees will include multiple years due if applicable. The current vendor fee for a business card website is $35/year and $495/year for the full website. To avoid service interruption please remit payment at your next convenience.<br />\n<br />\n" + MsgBC2011 + " " + MsgF2011 + "<br />\n" + MsgBC2012 + " " + MsgF2012 + "<br />\n<br />\n<strong>Total Fees Due: $" + AgentFee + "</strong><br />\n<br />\nPay via PayPal by logging into you PayPal account and send payment to paypal@kcregionalhomes.com. If you don't have a PayPal account you can create one and <strong>send your payments for free online</strong>: <a href=\"https://www.paypal.com/\">Join PayPal</a> - click 'sign up' on the top menu.<br />\n<br />\nYou can also make a check payable to "Kansas City Regional Homes, Inc." and drop it by the office or mail it to:<br />\n<br />\nKansas City Regional Homes, Inc.<br />\nAttn: Accounts Receivables<br />\n12230 W. 135th St.<br />\nOverland Park, KS 66221<br />\n<br />\nThank you,<br />\n<br />\nRonald Byron<br />\nBroker/Owner<br />\nKansas City Regional Homes, Inc.<br />\nCell: 913-579-5118<a href=\"javascript:;\" onclick=\"checkAndReplace();\" class=\"zoho-button\">Done</a>"
- )
- }
- }
Parker Byron
Network Administrator
Kansas City Regional Homes, Inc.