How to gather form data into the script of another form

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!

  1. for each UnpaidAgent in Agent_Entry  [(((Owe_2011_Websites == "Business Card" || Owe_2011_Websites == "Full") || Owe_2012_Websites == "Business Card") || Owe_2012_Websites == "Full")]
  2. {
  3.     ExternalFormFullWebFee = Agent_Fee_Schedule[Business_Card_Website != 0].Business_Card_Website;
  4.     GetWebFeesFull = 495;
  5.     GetWebFeesBCard = 35;
  6.     AgentFee = 0;
  7.     PayPlanRemaining = 0;
  8.     PayPlanMsg = "";
  9.     MsgBC2011 = "";
  10.     MsgBC2012 = "";
  11.     MsgF2011 = "";
  12.     MsgF2012 = "";
  13.     if (UnpaidAgent.Owe_2011_Websites  ==  "Business Card")
  14.     {
  15.         AgentFee = (AgentFee  +  GetWebFeesBCard);
  16.         MsgBC2011 = "Business Card Website for 2011 - Amount DUE: $" + GetWebFeesBCard;
  17.     }
  18.     if (UnpaidAgent.Owe_2011_Websites  ==  "Full")
  19.     {
  20.         AgentFee = (AgentFee  +  GetWebFeesFull);
  21.         MsgF2011 = "Full website for 2011 - Amount DUE: $" + GetWebFeesFull;
  22.     }
  23.     if (UnpaidAgent.Owe_2012_Websites  ==  "Business Card")
  24.     {
  25.         AgentFee = (AgentFee  +  GetWebFeesBCard);
  26.         MsgBC2012 = "Business Card Website for 2012 - Amount DUE: $" + GetWebFeesBCard;
  27.     }
  28.     if (UnpaidAgent.Owe_2012_Websites  ==  "Full")
  29.     {
  30.         AgentFee = (AgentFee  +  GetWebFeesFull);
  31.         MsgF2012 = "Full website for 2012 - Amount DUE: $" + GetWebFeesFull;
  32.     }
  33.     if (UnpaidAgent.Payment_Plan  ==  "Yes")
  34.     {
  35.         PayPlanMsg = "You are currently on a payment plan, please send in your monthly payment per your agreement";
  36.         MonthlyFee = (AgentFee  /  12).round(2);
  37.         PayPlanRemaining = (AgentFee  -  UnpaidAgent.Payment_Plan_Collected);
  38.         if (PayPlanRemaining  <  MonthlyFee)
  39.         {
  40.             MonthlyFee = PayPlanRemaining;
  41.         }
  42.         sendmail
  43.         (
  44.             To       :  UnpaidAgent.Company_Email 
  45.             From     :  zoho.adminuserid 
  46.             Subject  :  ("KCRH Payment Plan Reminder") 
  47.             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&nbsp;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 &quot;Kansas City Regional Homes, Inc.&quot; and drop it by the office or mail it to:<br />\n<br />\nKansas City Regional&nbsp;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>" 
  48.         )
  49.     }
  50.     else if ((UnpaidAgent.Payment_Plan  ==  "No")  ||  (UnpaidAgent.Payment_Plan  ==  "N/A"))
  51.     {
  52.         sendmail
  53.         (
  54.             To       :  UnpaidAgent.Company_Email 
  55.             From     :  zoho.adminuserid 
  56.             Subject  :  ("KCRH Payment Reminder: Website Vendor Fees Due") 
  57.             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&nbsp;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 &quot;Kansas City Regional Homes, Inc.&quot; and drop it by the office or mail it to:<br />\n<br />\nKansas City Regional&nbsp;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>" 
  58.         )
  59.     }
  60. }


Parker Byron
Network Administrator
Kansas City Regional Homes, Inc.