Custom Functions - Calculate Commission - failure after migration from US to EU

Custom Functions - Calculate Commission - failure after migration from US to EU

Hello,

i would ask for help. My Custom Function - Calculate Commission stopped working and shows a failure.



Mismatch of data type expression. Expected List but found String

What is the problem? Could anyone help? 

Here is script:


  1. void automation.ObliczProwizje(Int quoteId)
  2. {
  3. quoteMap = zoho.crm.getRecordById("Quotes",quoteId.toLong());
  4. productDet = ifnull(quoteMap.get("Product_Details"),"");
  5. field1 = ifnull(quoteMap.get("Typ_Prowizji"),"");
  6. if(field1 == "Nowa")
  7. {
  8. fieldapiname = "Prowizja_Nowe";
  9. }
  10. if(field1 == "Nowa-Wznowienie")
  11. {
  12. fieldapiname = "Prowizja_Nowe";
  13. }
  14. if(field1 == "Wznowienie")
  15. {
  16. fieldapiname = "Prowizja_Wznowienia";
  17. }
  18. newvalue = 0.0;
  19. for each  eachProd in productDet
  20. {
  21. qty = ifnull(eachProd.get("quantity"),"0").toLong();
  22. total = ifnull(eachProd.get("total"),"0").toLong();
  23. productId = ifnull(eachProd.get("product"),"").get("id");
  24. proDetails = zoho.crm.getRecordById("Products",productId.toLong());
  25. newcommission = ifnull(proDetails.get(fieldapiname),"0.0").toDecimal();
  26. newvalue = newvalue + newcommission * total * 0.01;
  27. }
  28. params = Map();
  29. params.put("Total_Commission",newvalue);
  30. updateResp = zoho.crm.updateRecord("Quotes",quoteId.toLong(),params);
  31. info params;
  32. info updateResp;
  33. }

    Access your files securely from anywhere

          Zoho Developer Community




                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day



                                        Zoho Marketing Automation
                                                • Sticky Posts

                                                • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

                                                  Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
                                                • Custom Function : Automatically send the Quote to the related contact

                                                  Scenario: Automatically send the Quote to the related contact.  We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually. We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email. Please note that the quote will be sent as an inline email content and not as a PDF attachment. Please follow
                                                • Function #50: Schedule Calls to records

                                                  Welcome back everyone! Last week's function was about changing ownership of multiple records concurrently. This week, it's going to be about scheduling calls for records in various modules. Business scenario Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly. CRM
                                                • Function #37: Create a Purchase Order from a Quote

                                                  Welcome back everyone! Last week, we learnt how to calculate the total number of activities for a lead and further take note of the activity count for particular dates. For instance, from the period of Demo to Negotiation. This week, let's look at a function that lets you create a Purchase Order instantly from a Quote. Business scenario: In any form of business, one of the most important things to do is to document the transactions. Naturally, negotiation, signing an agreement, placing an order,
                                                • Function-2: Round-Robin assignment of records

                                                  Welcome back folks! Last week, we saw how to update sales commission in quotes using a custom function. This week, let's see an interesting use case asked by many of you - auto-assignment records by round-robin method. Business scenario: Right now, the solution allows you to auto-assign leads from web form and imported lists. Let us look at a need where you want to auto-assign leads from in-bound calls in a round-robin method, across modules. Prerequisite: You must create a permanent record in the


                                                Manage your brands on social media



                                                      Zoho TeamInbox Resources

                                                        Zoho DataPrep Resources



                                                          Zoho CRM Plus Resources

                                                            Zoho Books Resources


                                                              Zoho Subscriptions Resources

                                                                Zoho Projects Resources


                                                                  Zoho Sprints Resources


                                                                    Qntrl Resources


                                                                      Zoho Creator Resources



                                                                          Zoho Campaigns Resources


                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

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

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Trying to catch error with ZOHO.CRM.HTTP.get (Response Code)

                                                                                                    Hello, I'm trying to get response header from ZOHO.CRM.HTTP.get, in order to catch error like 404 or something else but it seems that ZOHO.CRM.HTTP.get() method only returns the body of the response, and I see no way to access the headers returned. Is
                                                                                                  • FSM - How to ADD PHOTOS to Estimates & Invoices

                                                                                                    How can you add photos to estimates and invoices that are being emailed to the client so the can see what you are estimating and your completed work?
                                                                                                  • Sent emails not going and showing "Processing"

                                                                                                    Hello Team, Could you please assist with sent emails showing "processing" and not actually going through? Many thanks and regards, Cycology
                                                                                                  • Free developer edition of Zoho CRM

                                                                                                    A question for Zoho and other developers: How can you set up a demonstration version of a Zoho CRM implementation to show employers/clients what can be achieved? Do you pay for Zoho CRM Enterprise/Zoho One for this purpose? Does Zoho offer a free version
                                                                                                  • "notes"-field in a task to full width?

                                                                                                    Hi, Is there someone that can tell me how to adjust the "notes"-field in a task, to full width? I already played around with 1 or 2 columns, but this has nu effect on the standard width. Thx in advance for your help. Cheers, Ralph.
                                                                                                  • Can I add Conditional merge tags on my Templates?

                                                                                                    Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
                                                                                                  • Dialing Microsoft Teams Phone Service via Zoho CRM

                                                                                                    I am using the VOIP option in Microsoft teams for my office phone system. I was hoping to have a way to dial numbers directly from Zoho CRM, but don't see anything in the Teams Integration or in the Telephony integration that will enable this. Does anyone
                                                                                                  • Where are scheduled emails stored?

                                                                                                    After you schedule an email to go out through the CRM, how do you go about changing that scheduled email? Or even where can I see the list of emails scheduled to go out? They are not listed in my Zoho Mail account in Outbox which has been the only answer
                                                                                                  • CRM Home Page Dashboard, how can i add zoho desk cases?

                                                                                                    How can i see which tickets are in my group as a dashboard component on the home tab in zoho crm? I don't see any way of adding this.
                                                                                                  • Issue Configuring SSO Integration with Cognito in Zoho Help Center

                                                                                                    Dear Zoho Support Team, We have been working on configuring SSO integration for our Zoho Help Center using Amazon Cognito. While the setup appears to be completed successfully, we are encountering an issue when attempting to access the Help Center. The
                                                                                                  • Custom Module missing SDK function fetchRelatedRecords(...) in a Client Script

                                                                                                    Good day, We have added a new module with a Multi-Lookup relation to Contacts.  When we tried to use the fetchRelatedRecords(id, related_list_api_name) function to get Related Records it is missing for our new custom module. https://js.zohocdn.com/crm/5124797/documentation/DotSDK/Modules.html
                                                                                                  • send file to ftp or another external service

                                                                                                    i'v created a zoho creator application for take a picture and rename it by phone. Now i need to send Each renamed pictures to my ftp or to specific folder on google drive...then, delete it from creator. (every picture recived it will processed by another program and stored on my Erp) HOW CAN I DO ??
                                                                                                  • Subform Client Script

                                                                                                    Good day,  I have a subform where users can subscribe to various magazines. I would like to prevent the user from selecting the same magazine twice when adding a new row. Is there a way to prevent the user from doing this? (Can it be done via a client
                                                                                                  • Checklist/ save to onedrive/ a group of items invoicing in Zoho FSM

                                                                                                    hi, is there a way to add a specific checklist to any WO without passing eachtime by the model customization? can we save file such picture directly in our sharepoint ak onedrive? is there any way to add a group of item pre defined to make invoicing easier
                                                                                                  • Introducing 'Queries' In Zoho CRM

                                                                                                    Hello everyone! We are here with an exciting feature - Queries in Zoho CRM! A little context before we dive right into the feature specifics :) In today’s fast-paced business environment, immediate access to relevant data is essential for informed decision-making.
                                                                                                  • Serious question: Are there actually "solo-preneurs"/small business owners who made Zoho-one work well for them?

                                                                                                    L.S. After already many years of continued struggle with Zoho-One, I am seriously wondering if there are actually solo-preneurs (one person small business owners - without a large, dedicated IT dept.) who got it (Zoho-One) to work well for their businesses.
                                                                                                  • Calendar Bookings in Recruit

                                                                                                    Hi there, We have recently started using Zoho recruit and although it has some great functionality there are a few gaps that are causing real headaches. One of those being how interviews are scheduled. The majority of our hiring managers are field based
                                                                                                  • Getting Error : Developer Tool Detected

                                                                                                    Hi Team, Getting the error during open the portal, error attached on the same ticket. Please check and help us to resolve the same.
                                                                                                  • Send Zoho Creator Template by Email or sendemail

                                                                                                    Hello All Question:- How we can send the Zoho creator email template using the send email by the workflow or using the Function? by the Workflow sendmail [ from: zoho.adminuserid to: "zohodeveloper@yopmail.com" subject: "Test Template" message: "Test
                                                                                                  • Upgraded to Zoho One but Zoho Meeting still says Free Plan

                                                                                                    I signed-up for the Zoho One plan. When exploring the applications included, I came across a problem with Zoho Meeting. It says it's the free plan. I emailed support but they sent me a link that doesn't work and, when I found the article on my own, it
                                                                                                  • 新年のご挨拶、直近のイベントスケジュール

                                                                                                    🎍🐍謹賀新年🎍🐍 ユーザーの皆さま、明けましておめでとうございます! コミュニティチームの中野です。 本年もよろしくお願い致します。 昨年のZoho Japanコミュニティでは、東京・大阪・名古屋・福岡 4都市でのユーザー交流会開催や、自社最大イベント「Zoholics Japan 2024」でZoho Championの皆さまとのパネルディスカッション、10月の東京ユーザー交流会では本社CRMプロダクトマネージャーを招きロードマップ解説セッションの実施、さらにZohoアンバサダープログラムのローンチ(近日公開予定)など、新たな取り組みに挑戦しました。
                                                                                                  • Directly Edit, Filter, and Sort Subforms on the Details Page

                                                                                                    Hello everyone, As you know, subforms allow you to associate multiple line items with a single record, greatly enhancing your data organization. For example, a sales order subform neatly lists all products, their quantities, amounts, and other relevant
                                                                                                  • Request to Customize Module Bar Placement in New Zoho CRM UI

                                                                                                    Hello Support and Zoho Community, I've been exploring the new UI of Zoho CRM "For Everyone" and have noticed a potential concern for my users. We are accustomed to having the module names displayed across the top, which made navigation more intuitive
                                                                                                  • Create workflow rules based on notes

                                                                                                    Last modified on 17/04/2023: Creating Workflow rules based on notes is now available for all Zoho CRM users in all DCs. Note that it was an early access feature available only upon request. As of April 13, 2023, it is rolled out for al Zoho CRM accounts.
                                                                                                  • Error 403: Forbidden When Updating Email Signature via API

                                                                                                    Hi Zoho Desk team, First, congratulations again on the excellent Zoho API. But, I’m encountering an issue while attempting to update an email signature via the API. Whenever I make a request to update the signature, the response returns an HTTP 403 Forbidden
                                                                                                  • Client script: Can not choose a date field for an onChange field event

                                                                                                    Hi Zoho Team Why can't I choose one of my date fields to trigger an onChange event? Is this a client script limitation, or something wrong with my instance? If it is a limitation, is this mentioned in the documentation anywhere? Thanks. Marcus
                                                                                                  • How to upload mass inventory quantity adjustment with batch number?

                                                                                                    I wanted to clean-up our inventory list; however, I have trouble performing the task as I don't know how to mass upload inventory adjustment with batch numbers. I don't want to do it manually as there are if not thousands at hundreds of inventory tr
                                                                                                  • [Important announcement] Zoho Writer will mandate DKIM configuration for automation users

                                                                                                    Hi all, Effective Dec. 31, 2024, configuring DKIM for From addresses will be mandatory to send emails via Zoho Writer. DKIM configuration allows recipient email servers to identify your emails as valid and not spam. Emails sent from domains without DKIM
                                                                                                  • Power BI connector (Zoho Creator) to Zoho Projects

                                                                                                    How can i connect power bi to Zoho Projects? domain is zoho.com How can i find workspace name, application link name and Report link name?
                                                                                                  • Upgrade User

                                                                                                    Hi Sir/Madame, I have 7 users in my organisation but I need upgrade more space only 2 users. Is it possibe? Thanks
                                                                                                  • Dashboard Auto-refresh

                                                                                                    Why is there no Auto-refresh on the Dashboard? People have been asking for the last 6 years for this function from what I can see in my reasearch, it seems like a very simple intergration for Zoho to achieve. on Sept. 2, 2014, this was added: Support
                                                                                                  • Console error with widget in View mode, not present in Edit Mode with ZOHO.CRM.API.updateRecord(config)

                                                                                                    hello i have that function to update an account records (from a widgets created with sigma) function handleCopyButtonCRMClick() { console.log('handleCopyButtonCRMClick'); /* * Fetch Information of Record passed in PageLoad * and insert the response into
                                                                                                  • add meeting link

                                                                                                    i want to add A meeting link in the mail when the user book the appointment then with the conformation mail i want to add meeting link there
                                                                                                  • Unable to add Guest Members

                                                                                                    We are having issues adding Guest Members to our Cliq account. We have sent out a number of request but it seems that only some people are able to access the platform. Others have received a message stating that they need to be granted access from an
                                                                                                  • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

                                                                                                    Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
                                                                                                  • Zoho One - White Label

                                                                                                    Releasing a white-label feature for Zoho One, or any software or service, can offer several advantages and benefits for both the company providing the software (Zoho in this case) and its users. Here are some key reasons for releasing a white-label feature
                                                                                                  • Missing parameters in request, any way i can figure out what parameters i need to add?

                                                                                                    const url = "https://people.zoho.com/people/api/forms/json/P_Task/insertRecord"; const inputData = { "Status": "Open", "Description": "Task to set up and configure Zoho Mail on desktop application.", "CreatedTime": "01-Jan-2025 10:30 AM", "Due_Date":
                                                                                                  • Elevating Email Security on Zoho Desk: DKIM Now Mandatory

                                                                                                    Hello Zoho Desk Users! It has been a wonderful journey with you on Zoho Desk. As we welcome 2025, we are strengthening our efforts to ensure a secure and seamless experience for you. To enhance email security, DKIM configuration will be mandatory for
                                                                                                  • Remove the [## XXXX ###] from subject replies

                                                                                                    For our organisation we would like to have the [## XXXX ###] removed from subject replies. Cheers, Jurgen 365VitaalWerken
                                                                                                  • Address Grabber function for Zoho

                                                                                                    I converted from ACT to Zoho. With ACT, I used an add-on called AddressGrabber to scrape the contact information from leads that I buy and contact information contained on emails and websites and directly add it as a new lead or contact. Does anyone know
                                                                                                  • Next Page