What?
A quick article on how to count within a map. I didn't have too much difficulty getting this to work and I'm not sure if there are better ways of counting so I'm documenting it to see if I can refine the code or find a some short codes that will do the same.

Why?
I'm aiming to automate a process which counts the number of products allocated to an account or in total for a purchase order. Let us assume we have the following in a form/report called "Stock_Upload":
copyraw
RowID	Name	            SKU	        Account Email	
0001	Test Product 1	    TEST001	    This email address is being protected from spambots. You need JavaScript enabled to view it.	
0002	Test Product 1	    TEST001	    This email address is being protected from spambots. You need JavaScript enabled to view it.	
0003	Test Product 1	    TEST001	    This email address is being protected from spambots. You need JavaScript enabled to view it.	
0004	Test Product 1	    TEST001	    This email address is being protected from spambots. You need JavaScript enabled to view it.	
0005	Test Product 2	    TEST002	    This email address is being protected from spambots. You need JavaScript enabled to view it.	
0006	Test Product 1	    TEST001	    This email address is being protected from spambots. You need JavaScript enabled to view it.	
0007	Test Product 1	    TEST001	    This email address is being protected from spambots. You need JavaScript enabled to view it.
  1.  RowID    Name                SKU            Account Email 
  2.  0001    Test Product 1        TEST001        This email address is being protected from spambots. You need JavaScript enabled to view it. 
  3.  0002    Test Product 1        TEST001        This email address is being protected from spambots. You need JavaScript enabled to view it. 
  4.  0003    Test Product 1        TEST001        This email address is being protected from spambots. You need JavaScript enabled to view it. 
  5.  0004    Test Product 1        TEST001        This email address is being protected from spambots. You need JavaScript enabled to view it. 
  6.  0005    Test Product 2        TEST002        This email address is being protected from spambots. You need JavaScript enabled to view it. 
  7.  0006    Test Product 1        TEST001        This email address is being protected from spambots. You need JavaScript enabled to view it. 
  8.  0007    Test Product 1        TEST001        This email address is being protected from spambots. You need JavaScript enabled to view it. 
The code is a for loop which iterates through each row, assigning an entry for a new product or account, and specifying the quantity for each.

How?
So depending on the number of levels, the count will be with a series if then else statements. See the results/yield section to determine which best fits your scenario:
Category: Zoho :: Article: 693

What?
A quick reminder on when I want to apply overall Tax or remove Tax from a quotes product line items.

Why?
I would apply the standard update function and although the response would say it modified the record, the tax wouldn't apply both visually and programmatically.

How?
A little undocumented this "feature" but the gist is if you want to add tax, it has to be built up in the tax options, if you want this to be zero, you need to pass the option of tax as zero and remove all other options.

What?
A sorta quick article to note how I can generate refresh tokens and access tokens using Zoho Deluge code (so within Zoho Creator, CRM or Books) without XML calls.

Why?
I find myself using this more and more now that API v1 is on the way out and Zoho Deluge by itself is limited somewhat with regards to functionality and record editing when compared to API v2.

How?
Note that this is using Zoho Deluge and not another server-side script such as PHP to send the requests via API.

What?
A quick reminder on how I got a working snippet of code to store the entries in the lookup already selected, check against another table/form for valid options, repopulate the list with the selected item and filtering the options available for selection.

Why?
This was for a multi lookup with staff as the list entries. The lookup needed to filter against various forms such as Staff Rotas, Leave Requests, Qualifications and some others.

How?
The aim/objective is the following:
  1. Store what was already selected in the lookups
  2. Clear the lookups list
  3. Restore what was originally selected as selected.
  4. Repopulate with a filter list of options (not selected but available)

What?
A quick article to document how to calculate the distance "as the crow files" between two coordinates given the latitude and longitude of each.

Why?
Well, you can pay for a good Google solution that will distance following roads and the such but.. the following is free albeit as-the-crow flies.

This makes use of an undocumented function in Zoho which is acos or inverse cosine. Just lifted from the JavaScript library figuring if it supports cos() then try this standard function. Note this has only been tested in Zoho Creator rather than Zoho CRM.

How?
This function returns the distance as the crow flies.

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Related Articles

Joes Revolver Map

Joes Word Cloud

google   work   form   data   need   error   user   page   display   source   report   select   table   parameter   server   joomla   deluge   version   name   creator   would   files   system   uploaded   used   function   database   license   value   file   program   windows   mysql   where   list   code   added   script   note   date   first   using   zoho   order   could   time   find   following   website   search   JoelLipman.Com

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.