What?
This is a quick article on how to generate a 5 letter code from several functions: one which returns 5 randomly selected characters and another two which convert a number to 5 letters.

Why?
Zoho doesn't have a function to generate random numbers or strings. There are workarounds however.

How?

What?
So this is an article for me on how to copy Joomla's and Wordpress' feature where a Title/Name value is converted to a search-engine friendly URL alias and is unique in the database. Ok that's a long sentence; let me try this:
  1. When I save a record in JoomlaCMS or WordpressCMS
  2. It creates a unique name to use in URLs
  3. I want that

Why?
These are used as inputs to server-side scripts for the sake of search-engine friendliness. There are no silver bullets here but I want to block any character that isn't a letter, a number or an underscore.

How?
Suppose the following exists as a MySQL database table called my_table_name:

What we have:
copyraw
/----------|-------------------|----------------------\
| id       | name              | url_alias            |
|----------|-------------------|----------------------|
| 1        | My *First* Test   | my_first_test        |
|          |                   |                      |
|          |                   |                      |
\----------|-------------------|----------------------/
  1.  /----------|-------------------|----------------------\ 
  2.  | id       | name              | url_alias            | 
  3.  |----------|-------------------|----------------------| 
  4.  | 1        | My *First* Test   | my_first_test        | 
  5.  |          |                   |                      | 
  6.  |          |                   |                      | 
  7.  \----------|-------------------|----------------------/ 
What we want:
copyraw
/----------|-------------------|----------------------\
| id       | name              | url_alias            |
|----------|-------------------|----------------------|
| 1        | My *First* Test   | my_first_test        |
| 2        | My *First* Test   | my_first_test_1      |
| 3        | My _-_First Test  | my_first_test_2      |
\----------|-------------------|----------------------/
  1.  /----------|-------------------|----------------------\ 
  2.  | id       | name              | url_alias            | 
  3.  |----------|-------------------|----------------------| 
  4.  | 1        | My *First* Test   | my_first_test        | 
  5.  | 2        | My *First* Test   | my_first_test_1      | 
  6.  | 3        | My _-_First Test  | my_first_test_2      | 
  7.  \----------|-------------------|----------------------/ 

Category: Personal Home Page :: Article: 677

What?
This is a quick article on different ways to get the current user ID in Zoho through code.

How?
I'm not a fan of method #1 but I only started developing in Zoho recently when API v1 was already being deprecated (end of life at the end of this year). So I'm familiar with the methods in API v2 or just using newer functions.

Zoho Creator - Integration with Shopify Checkout/Storefront API

What?
This is a not so quick article on how to build up a checkout cart page with Zoho Creator which directs the customer to a Shopify payment page.

Why?
I didn't find anything on the web via Google or Bing that clearly explained how to connect to Shopify API and build the checkout page without making my app into a Sales Channel.

How?
The trick is to actually ignore the Checkout API and the standard error(s) while trying to create a checkout with a storefront access token:
[API] Invalid key or access token (unrecognized login or wrong password)
or how about:
[API] This action requires merchant approval for write_checkouts scope.

Further to this, an order is created when a draft order accepts payment!


What
A quick post on how I managed to build a regex to extract all non-numeric characters (all non-digits) from a string.

Why?
I only want the digits/numbers from a string:
copyraw
v_PaymentTerms = "Credit Note - 30 Days";

// we want the 30 from the above string
  1.  v_PaymentTerms = "Credit Note - 30 Days"
  2.   
  3.  // we want the 30 from the above string 

How?
Category: Zoho :: Article: 674

What
A quick note as I had difficulty finding a clear answer on this. I need a cron job setup where the permissions for a database user is required to do a backup (reading and copying data from a LIVE database) to a copy of the database (inaccessible via other users).

How?
I want to list 2 methods here. One to create a .sql file of the backup but another to copy the contents to a copy of the database accessible only by root and and this database "backuper" user. For both methods, I grant the following to the user doing the backup on the database I want a backup of:
copyraw
GRANT SELECT, LOCK TABLES, EVENT, INDEX, REFERENCES, TRIGGER, SHOW VIEW ON 'my_live_db'.* TO 'mybackupuser'@'localhost' IDENTIFIED BY 'mybackupuser';
  1.  GRANT SELECT, LOCK TABLES, EVENT, INDEX, REFERENCES, TRIGGER, SHOW VIEW ON 'my_live_db'.* TO 'mybackupuser'@'localhost' IDENTIFIED BY 'mybackupuser'
Category: cPanel :: Article: 672

What?
I saw a lot of articles that would cover this but I wanted an example which includes headers and footers and how to get an automatic page-break-inside to not overlap these. Fine on screen but this is obviously for when it comes to printing.

Why?
I needed to create a template in HTML where the first page is a cover page (background image filling the page with a logo floating at the centre) and the next page has a table which is of variable length. Fine when the table was short and didn't have many rows. But the client will pick up the phone to you when the table has too many rows to fit on one page, and this overlaps onto the next, covering the footer and header...

How?
By spending a lot of time spinning on my chair and twiddling my thumbs...

What?
This is an article resolving an issue where a template will shrink all the text when in PDF preview.

Why?
Ok doesn't need a song and dance about it, but I went home yesterday downtrodden by an issue which I'd been working on for most of the day where I would remove all the styling and the text would still appear small. Sure I resized the text to about 46pt and everything was over 3000px in width but this is not good for a final solution. I thought maybe there was a setting for the default font size or where I've accidentally zoomed out in the browser... but these were red herrings as I have other templates that work fine.

How?
The error is one of those that you wouldn't consider relevant in this case, after all, all styling was removed... Here are two screenshots to demonstrate the issue:

What?
This is an article documenting how to update Creator from a workflow written in a Deluge Script held in ZohoCRM.

Why?
I've also started this article to document an issue we encountered where our code was as per the documentation provided, and the responses returned as successful, but the target fields did not update. This was as a result after changing the owner of the Creator app to another person and adding our previous Super Admin account as a "Developer".

How?
I'm going to demo two methods here using the <connection_link>

What?
This is an article to remind me how to search a column in an Excel file for values found in another column (in this example, on another worksheet in the same workbook).

How?
So for demonstration purposes, I'm using a new Excel file with two worksheets called "Sheet1" and "Sheet2" respectively.

What?
This article serves to explain how to split a spreadsheet consisting of multiple sheets into separate files per sheet.

Why?
The Excel file in question was about 36000 rows and had a file size of about 11Mb. In order for an import process to work, the import would only accept XLS files no greater than 1Mb. So our script has to split a single spreadsheet into multiple worksheets of 3000 rows each, and then output each sheet to a separate file that is formatted as XLS (Not *.xlsx).

How?
In summary, we are going to move the Excel file to a folder of its own. We're going to run two VBScripts in two stages, firstly to split the specified rows into sheets, then each sheet into a file each. And we want all the files generated to be created in the same folder.

What?
This is an article explaining the code needed to write a PHP script which generates an access token for a service account which in turn is used to list files in a team's Google Drive.

This is very different to my code for OAuth when attended: Google Authentication - OAuth 2.0 using PHP/cURL... In that this one doesn't prompt for a user. Again this script doesn't need the client libraries, composer, vendor, etc.

Why?
This took me the best part of a month to get working. It is taken from Google's documentation as well as other forums and websites that try to explain it. Do not waste your time like I did on the public key, verifying a JWT signature, or including any third-party libraries. You can do it in pure PHP and all you need is the JSON key that you generated in your Google console.

Applies to:
  • Google Drive REST API v3
  • Google OAuth 2.0 v4
  • Google Cloud Platform IAM
  • Google Suite
  • PHP v5.6.35

How?
I'm going to go through each section of the code to go through the logic and highlight any changes you may need to make.

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: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience 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

RSS Feed

Related Articles

Joes Revolver Map

Joes Word Cloud

order   report   would   user   source   server   note   first   mysql   function   display   client   create   need   added   error   zoho   license   field   database   google   uploaded   date   find   file   following   value   work   table   creator   version   where   used   website   data   name   script   parameter   page   system   windows   time   code   list   form   case   files   joomla   using   deluge   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 bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.