Getter error message Number of statement execution limit exceed Line:(216)

Getter error message Number of statement execution limit exceed Line:(216)

Hi, this script is giving me error message "Number of statement execution limit exceed Line:(216)". Please advise

htmlpage Pay_Period_Details(PayPeriodID,AgentID,ShowPrint,start_range,end_range)
displayname = "Pay Period Details"
content
<%{
/* Get The current Pay Period Record */
Int_Pay_Period_ID = PayPeriodID.toLong();
Current_Pay_Period_Record = Pay_Period[ID == Int_Pay_Period_ID];
Previous_Pay_Period_ID = thisapp.Application.GetPreviousPayPeriodID(Current_Pay_Period_Record.ID);
/* Checking Agent ID is a valid Agent ID */
if(input.AgentID != null && input.AgentID != "" && FormA[ID == AgentID.toLong()].count() == 1)
{
//This input parameter is a valid Agent ID
Int_Agent_ID = AgentID.toLong();
}
%>
<style>
    .centerAlign
  {
  text-align:center;
  }
  .rightAlign
  {
  text-align:right;
  }
  .rightAlignTd td
  {
  text-align:right;
  }
  .boldTd td
  {
  font-weight:bold;
  }
  .leftAlign
  {
  text-align:left;
  }
  .width33
  {
  width:33%;
  }
  .width12
  {
  width:12%;
  }
  .width8
  {
  width:8%;
  }
  .customBodyStyle
  {
  margin:10px 10px 10px 10px;
  }
  .floatRight
  {
  float:right;
  margin-right:10px;
  }
  </style>
  <style media="print">
  .pageBreakBefore
  {
  page-break-before:always;
  }
  </style>
  <div style="customBodyStyle">
<%
/* EACH AGENT CONTAINER */
Int_Start_Range = start_range.toLong();
Int_End_Range = end_range.toLong();
Total_Record_Count = FormA[ID != 0].count();
//Initilize Agent Counter
Agent_Index = 0;
for each  Agent_Record in FormA sort by Last_Name range from Int_Start_Range to Int_End_Range
{
//When Agent ID has been provided, we render only for that agent or when input agent id is not provided
//we loop for all existing agents
if(Int_Agent_ID == null || Agent_Record.ID == Int_Agent_ID)
{
Agent_Daily_Record_Count = FormB[Agent == Agent_Record.ID && Date_field >= Current_Pay_Period_Record.Start_Date && Date_field <= Current_Pay_Period_Record.End_Date].count();
// Now we have to include those agents who are either active or have atleast one record in the pay period
if(Agent_Record.Status == "Active" || Agent_Daily_Record_Count > 0)
{
//Initilize
/* Previous_Pay_Period_Payout = 0.0; */
Running_Total = 0.0;
//Determine the previous payout for the agent
//Accounting for the fact that Agent counld not have existed in the previous pay period
if(Previous_Pay_Period_ID != -1 && Pay_Period_Agent[Pay_Period_ID == Previous_Pay_Period_ID && Agent_ID == Agent_Record.ID].count() == 1)
{
//if ((Previous_Pay_Period_ID  !=  -1)  &&  (Pay_Period_Agent[(Pay_Period_ID == Int_Pay_Period_ID && Agent_ID == Agent_Record.ID)].count()  ==  1))
Previous_Pay_Period_Agent_Record = Pay_Period_Agent[Pay_Period_ID == Previous_Pay_Period_ID && Agent_ID == Agent_Record.ID];
//Previous_Pay_Period_Agent_Record  =  Pay_Period_Agent  [(Pay_Period_ID == Int_Pay_Period_ID && Agent_ID == Agent_Record.ID)];
/* Previous_Pay_Period_Payout = Previous_Pay_Period_Agent_Record.Payout; */
// Running_Total = (Previous_Pay_Period_Agent_Record.Pay_Period_Balance  -  Previous_Pay_Period_Agent_Record.Payout);
Running_Total = Previous_Pay_Period_Agent_Record.Pay_Period_Balance;
}
%>
<div
<%
if(Agent_Index > 0)
{
%>
class="pageBreakBefore"
<%
}
%>
>
<%
Agent_Index = Agent_Index + 1;
%>
<br/>
<table class="zc-viewtable zc-viewrow">
<%
if(input.ShowPrint == "False")
{
%>
<tr class="zc-grouprow">
  <td colspan="3">
Pay Period <%=Current_Pay_Period_Record.Start_Date%> to <%=Current_Pay_Period_Record.End_Date%>
</td>
</tr>
<%
}
%>
<tr class="zc-grouprow">
  <td class="width33"><%=Agent_Record.Last_Name%>, <%=Agent_Record.Name%> - <%=Agent_Record.Position%>
<%
if(input.ShowPrint != "False")
{
%>
<%
}
%>
</td>
<td class="rightAlign width33"></td>
<%
/* Previous Payout: $ <%=Previous_Pay_Period_Payout%> */
%>
<td class="rightAlign width33">Previous Balance:$ <%=Running_Total%></td>  
  </tr>
</table>
<table class="zc-viewtable">
  <tr class="zc-viewrowheader">
<th class="width12 centerAlign">Date</th>
<th class="width8 centerAlign">Sales</th>
<th class="width8 centerAlign">Front</th>
<th class="width8 centerAlign">Comm<br/>pay</th>
<th class="width8 centerAlign">Bonus</th>
<th class="width8 centerAlign">Cash<br/>Recieved</th>
<th class="width8 centerAlign">Supp/<br/>Trans</th>
<th class="width8 centerAlign">Total<br/>Cancel</th>
<th class="width8 centerAlign">Cancel<br/>comm</th>
<th class="width8 centerAlign">Bonuses<br/>Lost</th>
<th class="width8 centerAlign">Day Total</th>
<th class="width8 centerAlign">End Balance</th>
</tr>
<%
//Initilize the Day Index
Date_Index = Current_Pay_Period_Record.Start_Date;
//Initilize all Total variables
Total_Sales = 0;
Total_Commission = 0.0;
Total_Total = 0.0;
Total_Bonus = 0.0;
Total_Draw = 0.0;
Total_S_T = 0.0;
Total_Total_Cancelations = 0.0;
Total_Cancellation_1_Commission_amount = 0.0;
Total_Bonus_Lost = 0.0;
Total_Ending_Balance = 0.0;
for each  Dummy_Record in Dummy
{
//Making sure that we remain in the bounds of the pay period
if(Date_Index <= Current_Pay_Period_Record.End_Date)
{
//Account for the condition when there are no records for the agent for a given day
if(FormB[Agent == Agent_Record.ID && Date_field = Date_Index].count() > 0)
{
//In this case we pull the records from the database.
//There could be multiple day records per agent per day
for each  Agent_Day_Record in FormB[Agent == Agent_Record.ID && Date_field = Date_Index] sort by Added_Time
{
%>
<tr class="zc-viewrow rightAlignTd">
  <td class="leftAlign"><%=Agent_Day_Record.Date_field%></td>
<%
Total_Sales = Total_Sales + ifnull(Agent_Day_Record.Sales,0);
%>
<td><%=ifnull(Agent_Day_Record.Sales,0)%></td>
<%
Total_Commission = Total_Commission + ifnull(Agent_Day_Record.Commission,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.Commission,0.0)%></td>
<%
Total_Total = Total_Total + ifnull(Agent_Day_Record.Total,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.Total,0.0)%></td>
<%
Total_Bonus = Total_Bonus + ifnull(Agent_Day_Record.Bonus,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.Bonus,0.0)%></td>
<%
Total_Draw = Total_Draw + ifnull(Agent_Day_Record.Draw,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.Draw,0.0)%></td>
<%
Total_S_T = Total_S_T + ifnull(Agent_Day_Record.S_T,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.S_T,0.0)%></td>
<%
Total_Total_Cancelations = Total_Total_Cancelations + ifnull(Agent_Day_Record.Total_Cancelations,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.Total_Cancelations,0.0)%></td>
<%
Total_Cancellation_1_Commission_amount = Total_Cancellation_1_Commission_amount + ifnull(Agent_Day_Record.Cancellation_1_Commission_amount,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.Cancellation_1_Commission_amount,0.0)%></td>
<%
Total_Bonus_Lost = Total_Bonus_Lost + ifnull(Agent_Day_Record.Bonus_Lost,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.Bonus_Lost,0.0)%></td>
<%
Total_Ending_Balance = Total_Ending_Balance + ifnull(Agent_Day_Record.Ending_Balance,0.0);
%>
<td>$ <%=ifnull(Agent_Day_Record.Ending_Balance,0.0)%></td>
<%
Running_Total = Running_Total + ifnull(Agent_Day_Record.Ending_Balance,0.0);
%>
<td>$ <%=Running_Total%></td>
  </tr>
<%
}
/*END - For each day record */
}
else
{
//There is no database record. So we dummy up a 0.0 record
%>
<tr class="zc-viewrow rightAlignTd">
<td class="leftAlign"><%=Date_Index%></td>
<td>0</td>
<td>$ 0.0</td>
<td>$ 0.0</td>
<td>$ 0.0</td>
<td>$ 0.0</td>
<td>$ 0.0</td>
<td>$ 0.0</td>
<td>$ 0.0</td>
<td>$ 0.0</td>
<td>$ 0.0</td>
<td>$ <%=Running_Total%></td>
</tr>
<%
}
/*END - Actual Day Record(s) OR dummy up record */
Date_Index = Date_Index.addDay(1);
}
/* END - Check that Date Index remains in bounds */
}
/* END - Running Counter on Dummy Record */
%>
<tr class="zc-viewrow rightAlignTd boldTd">
<td></td>
<td><%=Total_Sales%></td>
<td>$ <%=Total_Commission%></td>
<td>$ <%=Total_Total%></td>
<td>$ <%=Total_Bonus%></td>
<td>$ <%=Total_Draw%></td>
<td>$ <%=Total_S_T%></td>
<td>$ <%=Total_Total_Cancelations%></td>
<td>$ <%=Total_Cancellation_1_Commission_amount%></td>
<td>$ <%=Total_Bonus_Lost%></td>
<td>$ <%=Total_Ending_Balance%></td>
<td>$ <%=Running_Total%></td>
</tr>
</table>
</div>
<%
}
else
{
if(!input.ShowPrint == "False" && Int_Agent_ID != null)
{
%>
<div class="centerAlign">Agent is Inactive.</div>
<%
}
/* END - Ensure that is not Print */
}
/* END - If Agent is active or has at least one day record */
}
/* END - Check on presence of Agent ID */
}
/* END - Loop on all agents on Agent Table */
/* END == EACH AGENT CONTAINER */
%>
</div>
<%

}%>


        • Recent Topics

        • DKIM cannot be enabled for the domain as no verified default selector present

          Can't get the DKIM working. May you please check my account (nksy.us) to see what's wrong?
        • Contacts per department

          Hello, Is it possible to limit Contacts to a Department? Thanks
        • Collections Management: #3 Tackling Payment Failures

          Sam refreshed the dashboard. "Payment failed". Same customer. Same subscription. This is happening for the third time. He sends a usual email: "Your renewal payment failed again. Could you please check and retry?" A couple of days passed, and there was
        • How do I increase the email attachment size in Zoho CRM ?

          It looks like I'm limited to 10MB when sending an attachment using the email widget on a record in Zoho CRM. Is there a way to increase the size? Or can I use some other tool? From what I'm reading online, I'm maxed out at 10MB. Any insight would be greatly
        • Problem : Auto redirect from zoho flow to zoho creator

          Hi there, I've been waiting for zoho team to get back on this for last couple of days. Anyone else have the problem to access zoho flow? everytime I click on zoho flow it redirects me to zoho creator. I tried incognito mode but it still direct me to zoho
        • WhatsApp Channels in Zoho Campaigns

          Now that Meta has opened WhatsApp Channels globally, will you add it to Zoho Campaigns? It's another top channel for marketing communications as email and SMS. Thanks.
        • Zoho sign and creator error message {"code":9043,"error_param":"Checked by","message":"Extra key found","status":"failure"}

          Good day, I receive the error message: {"code":9043,"error_param":"Checked by","message":"Extra key found","status":"failure"} when running below code from creator to sign, void TestForSign(int ID) { //Fetch Template Details (Optional, for dynamic mapping)
        • Download a writer template as .docx instead of .pdf.

          I have been trying to implement a feature to download a writer template as a .docx and got it working partly but it isn't good. Earlier I checked our code and I saw openurl("https://crm.zoho.com/crm/org121314/specific/Template.do?action=print&step=pdfPreview&id="
        • Allow the usage of Multi-Select fields as the primary field on "Layout Rules"

          We want to force our users to enter some explanation strings when a multi-select field has been utilized. I can't understand the reason for the usage restriction of Multi-Select fields as a primary field. This is a simple "Display hidden mandatory field
        • Extract Archived Projects using Zoho Projects API

          In my organization we archive the projects when they are already completed, charged, invoiced, so that only those that are still pending process remain active. I need to access all projects (active and archived) from an external system, but the API v3
        • Ask the Experts: Five-hour live Q&A session with Zoho WorkDrive product experts

          Have questions about WorkDrive 5.0? Let’s talk! We recently launched Zoho WorkDrive 5.0, packed with powerful updates to help your team work smarter, stay secure, and get more value from your business content. From content-centric workflows and AI-powered
        • File upload support for subforms

          Dear All, Subforms help you add and track data related to your CRM records. We've always supported most of the commonly used field types in subforms, so as to cater to your business requirements. Now we're happy to extend support to file upload fields.
        • Circular record relationship in CRM

          Given there is a lookup in custom module Transactions creating a related list on the chosen Contact record. I. e. a lookup field on Transactions module points to Contacts. The related list on a Contact record can thus have have many transaction records.
        • Is it possible to pull the Zoho desk data into Zoho analytics in real time

          Hi - I am looking to add more dashboards and reports of Zoho Desk in analytics. I see there is a schedule to pull the data into analytics, but I'm wondering if there is an option to pull the data in real time instead of a specific interval?
        • Enhance productivity with the revamped Zoho Sheet View

          Hello folks, For some time now, you've been able to use the Zoho Sheet View to quickly edit multiple records or to insert a batch of new records. Its tabular interface allows users to engage in these tasks productively. Despite this, the existing Sheet
        • How to set value of dropdown field to variable

          For the life of me, I can't figure out why the following code won't set input.status to the previousSelection. Steps to reproduce: 1. Click input.complete 2. input.status dropdown updates from '1-Backlog' to '4-Done' 3. Click input.complete again to deselect
        • [Product Update] TimeSheets module is now renamed as Time Logs in Zoho Projects.

          Dear Zoho Analytics customers, As part of the ongoing enhancements in Zoho Projects, the Timesheets module has been renamed to Time Logs. However, the module name will continue to be displayed as Timesheets in Zoho Analytics until the relevant APIs are
        • [WEBINAR][MEA] Learn how to control your inventory and multi-channel sales with the Zoho Inventory & Zoho Books integration

          Hello there, We are hosting an exclusive live webinar tailored for businesses across the Middle East and African countries, where you'll learn how to take full control of your inventory and multi-channel sales while keeping your accounting perfectly in
        • Less clicks, more connection – the usability edge of Zoho Desk

          Imagine joining a new workplace, eager to prove your skills, partner with peers, learn new tools, and build a strong foundation for your career. The standards you've set could drive pressure into your head. You now discover the organization is using Zoho
        • Tip #3 Automating total item weight calculation for your sales orders in Zoho Inventory

          Hello, Hope the day is treating you well. Last week, we saw how we could automate the calculation of total shipping charges from numerous shipments for your sales orders and invoices. This week, we will see how you can automate the calculation of total item weight for your sales orders.  How does this work? First, you are required to capture the weight of all your items using a custom field. And when you create a sales order, you can either have the system display the individual weights for you or
        • Why Format section gets disabled when we create Merge Template over PDF

          I need some assistance I have a Client who is going to give certificates to users who passes his exam. So, I am using mail merge but in ZOHO writer after I upload the PDF and create merge Template over PDF the format Section gets disabled. My problem
        • Whatsapp Integration on Zoho Campaign

          Team: Can the messages from Zoho Campaign delivered through Whatsapp... now customers no longer are active on email, but the entire campaign module is email based.... when will it be available on whatsapp.... are there any thirdparty providers who can
        • How to calculate separate totals for Product Line Items filtered by category in Quotes?

          Hello! I'm working with Quotes in Zoho CRM and need help calculating conditional totals for line items. Current setup: I have two tables in my Quote template (Zoho Writer), both displaying Quoted Line Items Table 1 (top): Shows all products where Product
        • I Need Help Verifying Ownership of My Zoho Help Desk on Google Search Console

          I added my Zoho desk portal to Google Search Console, but since i do not have access to the html code of my theme, i could not verify ownership of my portal on Google search console. I want you to help me place the html code given to me from Google search
        • Zoho Desk API Documentation missing a required field

          We are trying to create a section using this information. Even after preparing everything based on that page, we still get an error. The error we get is this: {"errorCode":"INVALID_DATA","message":"The data is invalid due to validation restrictions","errors":[{"fieldName":"/translations","errorType":"missing","errorMessage":""}]}
        • Fetch Subform values through a lookup of a lookup

          Hi, I'm having an issue fetching the values of a subform through a lookup field through another lookup field. The code works perfectly to show me the subform row ID, but the second I try to get any readable data, it says "Error occurred. Please contact
        • Turn Decision Box to a button

          Dear all, I need your help on CSS to turn a Decision Box to a Button. I have a Decision Box like: Turn on/off to refresh the information. (on User Input, either True or False, will refresh the information) Now I want to simulate to treat it like a Refresh
        • Emails not being received from a particular domain

          Cannot receive any emails sent from atco.com Domain is in the spam whitelist so should be no reason for it not to be coming through. Have filed a ticket and besides a generic response of we are looking at it - it seems there is no actual support workers
        • Stock Count

          The stock count is a nice new feature, but we cannot figure out how to: 1. Use it without assigning to a person, we have a team or one of multiple do stock counts as do most any company. 2. Add any extra fields to what the "counter" sees. The most important
        • Can you import projects into Zoho Projects yet?

          I see some very old posts asking about importing project records into Zoho Projects. But I can't find anything up to date about the topic. Has this functionality been added? Importing tasks is helpful. But we do have a project where importing projects
        • How to delete attachments form Zoho mail accounts

          I can't find a way to delete attachments from Zoho mail messages, either individually or in bulk. Searches here are providing conflicting results and often talk about workspace, whereas I am only interested in how to delete attachments that are seen with
        • Send Whatsapp message from Whatsapp template with custom variables

          Hi, I'm trying to do some basic integration for sending WhatsApp messages from Zoho CRM using Zoho Desk whatsapp templates. When creating new whatsapp template in Zoho Desk we can choose ticket related fields as variables but it's not clear how to use
        • Outgoing blocked: Unusual activity detected.

          I just made payment for my Zohomail Today and have been debited so i will like to be Unblocked because this is what it says (Outgoing blocked: Unusual activity detected) Thank you i await your swift responses
        • Integrating with My Own Application and ZOHO CRM Simultaneously

          I have my own WhatsApp bot that uses my WhatsApp business account. I want to use the same phone number to integrate with ZOHO as well. What is the recommended way to do that? Should I integrate my application with ZOHO, forwarding messages whenever the
        • How do i move multiple tickets to a different department?

          Hello, i have several tickets that have been assigned to the wrong department.  I am talking about hundreds of automatically generated ones that come from a separate system. How can i select them all at once to move them to another department in one go? I can select them in "unsassigned open tickets view" but i can't find a "move to another department" option. I also can't seem to assign multiple tickets to the same agent in that same view. Could somebody advice?
        • Account for Cryptocurrency Holdings in Zoho Books/Custom Currencies?

          Hello, I've recently started using Zoho to run my small business and I've really been enjoying all of its features. However, I've been struggling to find a way to account for cryptocurrencies in Zoho Books. My company mines a Cryptocurrency token called
        • Transferring CRM Attachments to Workdrive

          relatedrecords = zoho.crm.getRelatedRecords("Attachments","Conditions",conId); attachid = List(); for each ele in relatedrecords { attachementId = ele.get("id"); attachid.add(attachementId); } for each ele in attachid { counter = 1; downloadFile = invokeurl [ url: "https://www.zohoapis.com/crm/v2/Conditions/" + conId + "/Attachments/" + ele type: GET connection : "work_drive" ]; resp2 = zoho.crm.attachFile("Deals",dealId,downloadFile); resp3 = zoho.workdrive.uploadFile(downloadFile, dealWD, "PlaceHolder"+counter+"",
        • Payment system for donations management

          I manage an organization where we receive donations from payers. Hence, there is no need to first create invoices and then create payments received against the invoices. What are the recommended best practices to do this in ZohoBooks?
        • New Customization options in the module builder: Quick Create and Detail view

          Hello everyone, We have introduced two new components to the module builder: Quick create and Detail view. The Quick Create Component It is a mini form used to create a record and associate it to the parent record from a lookup field. For example, if you have a Deals lookup in the Contacts module, then you can associate existing deals or create a deal and associate it with the contact. You can customize this Quick Create form by adding standard as well as custom fields. There is no limit to the number
        • unblock my zoho mail account. outlines@zoho.com

          please unblock my zoho mail account, outlines@zoho.com
        • Next Page