Need Help with Creating a Sales Order Form on Creator

Need Help with Creating a Sales Order Form on Creator

I asked ChatGPT to write me some code for a sales order form that pulls data from Zoho Books and Zoho CRM. Essentially, I want to be able to check for duplicates using the email address, and also pull the auto-generated sales order number from Books. Then, when the sales order is filled, redirect to a page that says: Pending Appoval. Submit it for approval, when it's approved, automatically convert it to an invoice and go to a payment page.

This is my ChatGPT prompt:
1. Allow users to sign in using their Zoho Email and password. 2. User enters basic contact information into it. Check Zoho CRM / Books for duplicates using email address. If the record exists, use that record. If it doesn't exist, create a new record. Pull the tax rate from the record in Zoho Books if it exists. Allow users to change the tax rate from the available rates in the picklist that exists in Zoho Books. Apply this default tax rate to line items in step 2. 3. Allow users to select any number of products using a subform. Show images of each product, and allow sales reps to apply discounts to each line item. Pull these products from our product list inside of Zoho Books. We have already integrated Zoho Inventory with Zoho Books, so the products already display inside of Books. Show the tax rate for each product as well in each line item. Essentially copy the layout of sales orders and invoices from books in include it in this form. Include a grand total section, with a subtotal field, total tax field in dollars, shipping charge field, and price adjustment field. Apply tax only to subtotal, not shipping. 4. Once the sales order is good to go, show a button that says Submit for Approval. Then, send a webhook for the sales order that is pending approval, and a manager will approve the sales order. 5. Once the sales order is approved, automatically convert it into an Invoice and allow payment processing through Square. We have already integrated Square with Zoho Books. Get the payment link from the invoice, and redirect to that payment page. 6. After payment is processed, redirect to a thank you page.

This is what is responded with:

  1. // Step 1: Allow users to sign in using their Zoho Email and password.
    // Assuming you have a form with username and password fields

    // Step 2: Check for duplicates in Zoho CRM/Books and handle contact information
    // Here's a basic example of how you might do this

    // Check if contact exists in Zoho CRM or Books
    existingContact = zoho.crm.searchRecords("Contacts", "email:email_address");

    if(existingContact.isEmpty()) {
        // Create new contact
        newContact = zoho.crm.createRecord("Contacts", {"Email": input.email});
        // Check for tax rate in Zoho Books and set default tax rate
        // Code to pull tax rate from Zoho Books and set default tax rate
    } else {
        // Use existing contact
        existingContact = existingContact.get(0); // Assuming only one contact is found
        // Code to pull tax rate from existing contact in Zoho Books and set default tax rate
    }

    // Step 3: Allow users to select products and apply discounts
    // Assuming you have a subform for selecting products with fields like product name, quantity, price, discount, etc.

    // Step 4: Submit for Approval and send webhook
    // Assuming you have a button to submit for approval

    // Submit data to webhook
    response = postUrl("<webhook_url>", inputData);

    // Step 5: Convert sales order to invoice and process payment through Square
    // Assuming you have a button to convert to invoice and process payment

    // Convert sales order to invoice in Zoho Books
    invoice = zoho.books.createInvoice(inputData);

    // Get payment link from invoice (assuming Square integration is already set up)
    paymentLink = invoice.get("payment_link");

    // Redirect to payment page
    openUrl(paymentLink);

    // Step 6: Redirect to thank you page after payment processing
    // Assuming you have a thank you page URL to redirect to
    redirectUrl("<thank_you_page_url>");



        • Recent Topics

        • Reporting Limitation on Lead–Product Relation in Zoho CRM

          I noticed that Zoho CRM has a default Products related list under Leads. However, when I try to create a report for Lead–Product association, I’m facing some limitations. To fix this, I’m considering adding a multi-lookup field along with a custom related
        • Series Label in the Legend

          My legend reads 'Series 1' and 'Series 2'. From everything I read online, Zoho is supposed to change the data names if it's formatted correctly. I have the proper labels on the top of the columns and the right range selected. I assume it's something in
        • Dynamic Signature - Record owner

          Hi everyone, I’m using Zoho Writer merge templates from Zoho CRM and have two questions: Owner signature: How can I automatically insert the CRM record owner’s signature in the merged document? I’m not sure where this signature is stored or how to reference
        • Set Warehouse based on Vendor

          Greetings. I would like to set automaticaly the Warehouse based on the Vendor. Context: I am working on an adaptation of a Purchase Order to be used as a Quotation. I have defined that when a user has to raise a quote the Vendor will be "PROCUREMENT" I would like to set the Warehouse to a predefined value when "PROCUREMENT" is set as Vendor. I have tried to do with the Automation feature using the Field Update option, but Warehouse does not is listed as a field. Can you help? Thanks in advance.
        • Printing from Zoho Creator hosted on my own server to printers hosted on my clients local network

          Hello. Fairly new to Zoho Creator and looking for best options to be able to print from my application hosted on my own server to any printer hosted on my clients own local network. Any advice is welcome. Thank you.
        • Add System Pre-Defined Lookup Field to Subform?

          Hi there! New to using Zoho, so this may already exist, but I'm having trouble figuring it out. Is there a way to get the system pre-defined Account Lookup field (in our case, renamed to Company Name), as the starting point for a subform? In our company,
        • Numbered / bullet point List in Zho Cliq

          Hi, is there a way to format chat messages in Cliq like this Topic 1 Hey, I finished this project yesterday etc... Topic 2 I am still working on this etc...
        • Cannot Access Subform Display Order in Deluge

          As highlighted in this community post, we still have to deal with the significant limitation of not being able to access the user-sorted order of subform rows through Deluge. This creates a major disconnect between the UI capabilities and backend automation,
        • How many groups in Zoho Mail can I make?

          I'm currently on the free plan, which has a limit of 10 users. Does that limit includes groups too? If not, what is the limit for groups? Thanks!
        • Feature Suggestion for Zoho Social: Auto-reply to Comments or Keywords

          Hi Zoho team, I'd like to suggest a very specific feature that would be extremely helpful for customer engagement: the ability to automatically send a reply to comments on posts — either all comments or those containing specific keywords. For example,
        • My domain did not activate

          Hi, my domain (apsaindustrial.com.ar) did not activate, and the phone verification message never arrived. Please would you solve this problem? Thanks.
        • Already have Zoho account. Not letting me log in

          I already have a Zoho account that is associated with my Google email and my phone number. Even though I'm already logged in to Zoho, when I click on the mail icon to access my email, it takes me to the pricing page. When I click on the free option, it
        • ZOHO Mail App Not working

          There seems to be an issue with Zoho Mail App today. It is not connecting to server, internet is working fine, tried uninstalling app and reinstalling, loading circle keeps spinning round. Is there an update on the way?
        • facing error 550 5.4.6 while sending emails

          Please help me fix this issue
        • Allow Itemization for Recurring Expenses

          For whatever reason, one cannot itemize a Recurring Expense. This capability should be added. The use cases to support this are largely the same as what they were to allow for itemization in Expenses. Anything that would need to be itemized for a regular
        • Zoho reply to not working. just reply to my self

          Hello. i using on my wordpress website a contact form from Wsform. i can set the reply to email there. normally it works. but since i am using your wordpress plugin zoho mail it doesn`t work. its not using the reply to (email from customer). I just can
        • Painfully Slow Zoho mail

          Since yesterday Zoho Mail seems to have starting functioning very slowly and having a few bugs. It's slow to open mails, slow to send, slow to change between email accounts. Sometimes clicking on a particular folder (eg Sent folder) stops working and
        • Can't receive any email from other platform

          Hello,everyone, i'm just join zoho and create two email accounts for my own business. I was using it to get a verified email from stripe, but can't receive it. and I use my private gmail account to send test email twice, first time show below reply, but
        • Your Incoming has been blocked and the emails will not be fetched in your Zoho account and POP Accounts

          Can some on help me regarding our account . thank you so much
        • Zoho Creator integration with Sage 50

          Hi, Wondering if anyone has had any experience connecting Zoho to Sage 50 and could share any information on this matter. Thank you.
        • Conditional Email Forwarding

          How can I set conditional email forwarding of the users? For example: Mail should be forwarded to a address only if it comes from a particular sender. So, I want such email forwarding, which forwards mails based on particular conditions, like the incoming
        • Incoming emails not appearing in Inbox

          Hello, I have an issue with incoming emails sent from my website (domain: h2ostop.si). Emails are visible in the Sent folder, which means they are successfully sent through Zoho SMTP, but they never appear in my Inbox. Nothing arrives in Inbox, Spam,
        • Automatic Matching from Bank Statements / Feeds

          Is it possible to have transactions from a feed or bank statement automatically match when certain criteria are met? My use case, which is pretty broadly applicable, is e-commerce transactions for merchant services accounts (clearing accounts). In these
        • Email Opt Out Question

          Has the problem where if a customer is emailed opt out prevents you sending standard emails? For me this feature is simply to stop any email marketing and should not block people from receiving emails via Zoho mobile, which makes no sense.
        • Can No Longer Access Zoho Email Accounts from iPhone or iPad Apple Mail Apps ,.

          Keeps asking for password, Says ID or password incorrect. Tried creating a new app specific password. Same result. Is this possibly related to the server maintenance. Have verified all email settings, userid and password. This has worked for years until
        • Latest update caused issue in using marathi typingzoho

          With latest update now marathi typing does Not work in zohonotebook. I preferred zoho over other because it was supporting marathi font without any distortion.. But after new update,keyborad simply does not work
        • Login verification emails never received.

          I can't login to my account. You send a verification email, but it never arrives. This is a common problem, frequently caused by some relay point out there classifying the sender as a spammer. Is there anything I can do to bypass this? Maybe get a text
        • Global lists for Multi select

          It would be great if I could select a global list to use for a multi select dropdown filed.
        • Yahoo is rejecting e-mails sent from a Zoho server

          Diagnostic-Code: 4.7.0 [TSS04] Messages from 136.143.169.51 temporarily deferred due to unexpected volume or user complaints - 4.16.55.1; see https://postmaster.yahooinc.com/error-codes Remote-MTA: dns; mta5.am0.yahoodns.net
        • Yahoo blocks e-mail sent from Zoho servers

          Getting this for a bunch of Yahoo addresses. Do you know if some of your servers got blacklisted? Diagnostic-Code: 4.7.0 [TSS04] Messages from 136.143.169.51 temporarily deferred due to unexpected volume or user complaints - 4.16.55.1; see https://postmaster.yahooinc.com/error-codes
        • Working with dates and Function Field

          Hello friends! I'm trying to add days to a date, however the field function will always shows 00:00:00 after the resultant date. How can I display only the date, whithout the time? toDate(input.request_date.addDay(input.Prazo_acordado),"MM,d,yyyy") The code above will result something like "11-Feb-2020 00:00:00", but I want to display only "11-Feb-2020"
        • What's New in Zoho Analytics - November 2025

          We're thrilled to announce a significant update focused on expanding your data connectivity, enhancing visualization capabilities, and delivering a more powerful, intuitive, and performant analytics experience. Here’s a look at what’s new. Explore What's
        • Unable to send message;Reason:550 5.4.6 Unusual sending activity detected. Please try after sometime.

          Please help my account got blocked automatically, can you help me how to avoid it? Thanks so much
        • Unusual activity detected from this IP. Please try again after some time

          When i try to create new addresses on my account i am getting this error, it has been 24 hours now and i am still getting this error can anyone help
        • temporary system errorlouis

          J'essaye d'envoyer des mails avec mes 2 adresses mail qe nous avons sur le compte arthur@lepunch.fr et louis@lepunch.fr mais j'ai toujours le message temporaire system error, je reçois les mails mais impossible d'en envoyer a qui que ce soit
        • How to Cancel/Delete Queued Mail Merge?

          Hi. I just tried to do a mail merge before realizing there's a limit on number of sends. I accidentally sent one of my lists twice, and all of those emails are currently queued. Is there any way to cancel or delete a queued mail merge? Would love to be
        • Need to add a new admin for my domain

          Hello Zoho Support, I am the owner of the domain localeistanbul.com. The current super admin account (admin@localeistanbul.com) is not accessible. I do not want to reset or delete the existing account because I need to keep all existing emails. Please
        • Possible Fraud Site.

          Hello. I received a text with the sender's name as zoho, claiming that my account was at risk and that I should sign in at https://verify.zohomails.ru/signin to verify my account. I signed in on the web address above, and a few days later someone hacked
        • Zoho mail to Teaminbox

          Hello, We're searching for new mail program. Now I'm testing a bit with zoho mail and team inbox. My findings in the research: Pop mail throught zoho mail is almost instant. Any pop or imap via external provider takes a couple minutes to 15 minutes before
        • Crear tarea CRM con recordatorio desde Zoho Flow

          Hola, estoy intentando crear desde Zoho Flow una tarea en CRM. Lo he logrado hacer pero sin recordatorio, ya que no se como se debe escribir el string adecuado. He probado varias alternativas, pero ninguna me funcionó hasta ahora. - FREQ=NONE;ACTION=EMAIL;TRIGGER=DATE-TIME:${FechaVto}
        • Next Page