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>
<%

}%>

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ






                                ご検討中の方

                                  • Recent Topics

                                  • Assistance Required: Authentication Error When Sending Credit Application Form

                                    Hi, I'm encountering an error message that states: "Authentication unsuccessful – the user credentials were incorrect." This occurs when I attempt to send the credit application form to our customers. I've attached the form I’m trying to send for your
                                  • Can zoho sign collect data feeding Zoho Sign?

                                    I m sending contracts to client who are not in my zoho CRM database yet. Can the data they enter in Zoho sign contract I send them, (that includes...) official company name address first name second name etc, ...Create or update a contact / account
                                  • Sync desktop folders instantly with WorkDrive TrueSync (Beta)

                                    Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
                                  • 6 time-saving tips for working with tables in Zoho Writer

                                    Tables have always been the best way to represent data. They help you structure and categorize information systematically and present them in a simpler way. While tables in Zoho Writer are easy to implement, some tasks might not be that obvious.  Here are some time-saving tips to help you work better with tables in Zoho Writer:    1. Insert Multiple Rows / Columns in a Table Adding more rows and columns is the most common action performed while working with tables. Instead of using the Table tab,
                                  • Modified approved time log

                                    I can’t seem to find a way to make change to approve time log entry. The case is the following. We pay the employees every 2 weeks, so employe A enter is time for the 2 weeks and then submit his timesheet. Now is superior approve the time he worked via
                                  • Question Regarding Deleted Reports in Zoho Desk Analytics

                                    Dear Zoho Desk Support Team, I hope this message finds you well. We have a question regarding the Analytics module in Zoho Desk, specifically related to deleted reports/dashboards. We would like to understand the following: Is there a recycle bin, recovery
                                  • Making money out of Zoho Sheets - How?

                                    Hello, Suppose I come up with a brilliant Zoho Sheet that I want to sell to other people, can I do this? How? Thanks.
                                  • Adding Columns to Reports

                                    Hi, Is it possible to choose fields to be added as columns in the reports? Thank you.
                                  • Sudden Layout Issue After Last CSS Update for ZML (Temporary Fix Inside)

                                    Hi, Our clients have noticed today that every section laid out with ZML suddenly shows an unwanted top padding/blank space that interrupts the user screens. It appears that Zoho has changed the default CSS for the .zcp-col.zcp-panel-rowtype-auto element.
                                  • What are people using to send Service based emails?

                                    Zoho Campaigns is for marketing. Users can unsubscribe from these emails. Service based emails need to be delivered and can without the worry of Can-spam act. What are people using to send service based emails? My mailing list is derived from a database
                                  • Client Script also planned for Zoho Desk?

                                    Hello there, I modified something in Zoho CRM the other day and was amazed at the possibilities offered by the "Client Script" feature in conjunction with the ZDK. You can lock any fields on the screen, edit them, you can react to various events (field
                                  • Introducing Zoho Commerce 2.0 — It's more than just selling!

                                    Hello! We are proud to launch Zoho Commerce 2.0, a reimagination of how online businesses look, feel, and function. This launch is both timely and symbolic, as we reaffirm our commitment to empowering small and medium enterprises with powerful, yet simple-to-use
                                  • Kits: Option to Hide Associate Items on Documents

                                    The new Kit type of Composite Item is very helpful, and we're already using it in several different ways. One problem is that there seems to be no way to hide the components on some documents, including Package Slips. There is an option given in settings
                                  • Unable to display field label from a hidden Single Line Textbox in Description

                                    Hi folks, I'm unable to display my hidden field, e.g. ${zf:SingleLine4} , in my description. I'm pre-filling this hidden Single Line Text box via "Field Alias - Pre-fill URL" settings. I noticed that my decimal form fields work, e.g. ${zf:Decimal}, and
                                  • An Exclusive Session for Zoho Desk Users: AI in Zoho Desk

                                    A Zoho Community Learning Initiative Hello everyone! This is an announcement for Zoho Desk users and anyone exploring Zoho Desk. With every nook and corner buzzing, "AI's here, AI's there," it's the right time for us to take a closer look at how the AI
                                  • Email for customer to provide payment information

                                    Is there a way for customers when you set up a subscription to get an email that prompts them to put in their billing information to start their subscription? Also, can you show the subscription in their portal?
                                  • Ticket Automatically Created from Closed Chat

                                    Is there a way to prevent a ticket being create for every chat.... or at the very least have it automatically closed.
                                  • I want to Show the product list based on the drop Down

                                    in quotation app , amc form form i have Department drop down field and in subform i have loop up field item description taken from the anothe app PRO I want to show the product list look up based on the deparment selected example if they selected deparment
                                  • Bad User: Authenticated but not connected

                                    Zoho CRM cannot send/receive emails and it appears as if it may be an api configuration change either via Zoho or MS. Does anyone have information on how to fix this error message? I am admin on all my accounts. Zoho and MS are blaming each other.
                                  • Zoho + ERP (SAP)

                                    First of all: I'm using Zoho CRM and I have complete right that it's a brilliant solution for sales force. But, in my new job, doesn't exist a CRM system and I want propose Zoho CRM. In the company, we're using a ERP (SAP), a few time ago. I would like to know about integration between Zoho CRM and ERP (SAP), as possible? How I can do that? Regards, Renato Lima
                                  • Lookup fields

                                    Is there any way to add Lookup fields to Zoho FSM -- I do not see the option but I see default lookup fields in different modules
                                  • Sort data in Pivot Table

                                    Is it possible to sort by a data field. I can gruop and filter, but I culdn't find how to sort the results. Tank You.
                                  • Inventory Barcode Creation - Add Picture of Item

                                    Hi I am trying to set up bar code labels and include a picture of the item on the label - any idea on how to add that field to the barcode generator?
                                  • Shared Snippets Everyone

                                    Hi, Now that the Shared Snippets have been released and I think will be the most used feature implemented in 2023 :) Creating and Using Snippets in Ticket Responses - Online Help | Zoho Desk Maintain consistency in ticket responses with shared snippets
                                  • Please Enable Snippets for Agents Adding Comments

                                    Snippets and templates are currently enabled for agents when they use the reply functionality. There is currently no way to add a template or snippets when an agent comments. This is really weird. Our agents don't use the reply functionality, only the
                                  • Topics assigned to Contacts in Campaigns

                                    I have yet to find an efficient way to assign topics to contacts in campaigns with the new system in place.  We have daily contacts added to our system through various forms and we have to manually go in and add topics to contacts before each email campaign
                                  • CRM Email Insights Not Working - Status not Changing

                                    I used to be able to see if a customer opened/read an email in CRM, but I no longer get those status changes inside their record. I have everything enabled and I am sending the email from CRM. The experience center has the status' enabled as well. Any
                                  • Product and Service

                                    Hi guys, there is a difference between layout of product and service if Long Description field have some kind of text. Please see screenshot 1 for Service here: https://prnt.sc/7xWwPKd29nWP for Product here: https://prnt.sc/LGmtVd_U6H7q As you can see
                                  • The Urgent Need for Native Brazilian Payment Integrations: PIX and Direct Bank Connections

                                    Hello Zoho Team, I am writing to emphasize a critical functionality gap for Zoho Books in the Brazilian market: the lack of modern, native payment gateway integrations. The current options are insufficient. The Mercado Pago integration, for instance,
                                  • Better implementation of Item Category on Invoices and Estimates

                                    1) I have added Item Category as a custom field. Honestly, this should be a native part of the item itself, and either required, optional, or not used.  2) When entering an item on an invoice, you have to enter the first character(s) of the item, otherwise
                                  • Try CRM for everyone button in the way of workflow

                                    Please consider using the bottom bar for offers. Using the top bar for offers like "Try CRM for everyone" really gets in the way of my day to day workflow.
                                  • Zoho Signature, "For Demo Purpose Only Powered by Zoho Sign"

                                    How to disable this text on the documents for signature. "For Demo Purpose Only Powered by Zoho Sign"
                                  • Zoho CRM email formatting issues

                                    I have been having a hard time with formatting email templates. It feels like Zoho email is "fighting my edits." It refuses to change size, font, etc. Sometimes, the template looks great, then when the email gets sent, it looks completely different- some
                                  • Weekly Tips : Seamlessly collaborate with Share Drafts in Zoho Mail

                                    Ever found yourself stuck wondering how to get input on an important email draft without actually sending it? Maybe you want a teammate’s feedback or approval from your manager—without exposing sensitive info. Or perhaps you are working across different
                                  • How to Share a workdrive folder outside organization ?

                                    Hi, Earlier we were using Google Suite and were able to share the google drive folders with external organization ( Auditors , marketing collaterals ) as most of them had a personal gmail account they were able to access it without any issue. How can
                                  • Zoho CRM Account Duplication via Credit Application Form

                                    Hi, We send a credit application link to our customers via email, which is managed through Zoho Campaigns. When a customer submits the form, it automatically creates a new account in Zoho CRM. We would like to know how to stop this from creating duplicate
                                  • Multi file upload

                                    Hi, I just wonder if one could upload multiple files in one shot, say between one and three files, without adding multiple File Upload fields? Thanks, Alalbany
                                  • Flexible Milestone Invoicing

                                    If your Zoho Projects portal is integrated with Zoho Invoice/Books, you can now create an invoice for your milestones. You can enable it under Integration Preference and invoice milestones regardless of the project's billing type. For instance, consider
                                  • The get records i am getting produts that show in the show in the sub form item list field

                                    The get records i am getting produts that show in the show in the sub form item list field if(input.Department != null) { // Get filtered records once creator_ptid = zoho.creator.getRecords("harshadgroup","item-master","All_Products","Department == \""
                                  • Incorrect Handling of XLSX data

                                    Trying to import an XLSX schedule of bills into Zoho Books I ran across the problem of date formatting. To replicate: Build a CSV file with bill dates in whatever format you like and import it - this should work if you match the "dd/MM/yyy" etc. format
                                  • Next Page