custom fields not populating from deluge script into invoice

custom fields not populating from deluge script into invoice

Hello,

I've created some Deluge script that is meant to take a few inputted invoice custom fields and calculate a few others. I can see when I execute the function that my inputted custom fields are being passed, yet im still ending up with all "null" values at the bottom. Can someone take a look and see what I'm doing wrong?

info invoice;

// Fetch values from the custom fields
assessed_value = invoice.get("cf_assessed_value_unformatted");
final_value = invoice.get("cf_final_value_unformatted");
tax_rate = invoice.get("cf_tax_rate_unformatted");
ETP_Fee = invoice.get("cf_easy_tax_protest_fee_unformatted");
// Calculate Assessment Reduction
assessment_reduction = final_value - assessed_value;
// Calculate Tax Savings
tax_savings = assessment_reduction * tax_rate;
// Calculate Easy Tax Protest Fee (25% of Tax Savings)
easy_tax_protest_fee = tax_savings * ETP_Fee;
// Update the invoice with calculated values
invoice.put("cf_assessment_reduction",assessment_reduction);
invoice.put("cf_tax_savings",tax_savings);
invoice.put("easy_tax_protest_fee1",easy_tax_protest_fee);
// Save the updated invoice
zoho.books.updateRecord("invoices",ClientAPI,invoice.get("invoice_id"),invoice);
info "Assessment Reduction: " + assessment_reduction;
info "Tax Savings: " + tax_savings;
info "Easy Tax Protest Fee: " + easy_tax_protest_fee;

info "Assessed Value: " + assessed_value;
info "Final Value: " + final_value;
info "Tax Rate: " + tax_rate;
info "ETP Fee: " + ETP_Fee;

my log incase youre interested:

Log Messages

{"date":"2024-12-19","notes":"Thank you for the payment. You just made our day.","zcrm_potential_id":"","discount":"0.0","billing_address":"{\"zip\":\"99501\",\"country\":\"United States\",\"address\":\"639 Main St\",\"city\":\"Anchorage\",\"phone\":\"\",\"street\":\"639 Main St\",\"attention\":\"\",\"street2\":\"\",\"state\":\"AK\",\"fax\":\"\"}","line_items":"[{\"line_item_id\":\"5693121000000120027\",\"documents\":[],\"discount_amount\":0,\"item_type\":\"sales\",\"item_type_formatted\":\"Sales Items (Service)\",\"discount\":0,\"internal_name\":\"\",\"sales_rate_formatted\":\"$0.00\",\"discounts\":[],\"project_id\":\"\",\"sku\":\"\",\"pricing_scheme\":\"unit\",\"pricebook_id\":\"\",\"bill_id\":\"\",\"bcy_rate_formatted\":\"$0.00\",\"image_document_id\":\"\",\"expense_receipt_name\":\"\",\"item_total\":0,\"tax_id\":\"\",\"tags\":[],\"unit\":\"\",\"cost_amount\":0,\"tax_type\":\"tax\",\"time_entry_ids\":[],\"cost_amount_formatted\":\"$0.00\",\"name\":\"protest\",\"line_item_tds\":[],\"markup_percent_formatted\":\"0.00%\",\"discount_amount_formatted\":\"$0.00\",\"bcy_rate\":0,\"item_total_formatted\":\"$0.00\",\"salesorder_item_id\":\"\",\"discount_account_name\":\"\",\"rate_formatted\":\"$0.00\",\"header_id\":\"\",\"discount_account_id\":\"\",\"description\":\"\",\"item_order\":1,\"bill_item_id\":\"\",\"rate\":0,\"account_name\":\"Other Charges\",\"sales_rate\":0,\"quantity\":1,\"item_id\":\"5693121000000111097\",\"tax_name\":\"\",\"header_name\":\"\",\"item_custom_fields\":[],\"line_item_taxes\":[],\"markup_percent\":0,\"account_id\":\"5693121000000010001\",\"tax_percentage\":0,\"expense_id\":\"\"}]","payment_expected_date_formatted":"","shipping_charge_inclusive_of_tax":"0.0","balance":"0.0","bcy_shipping_charge_tax":"","terms":"","invoice_id":"5693121000000120019","shipping_charge_tax_exemption_code":"","invoice_number":"INV-000002","recurring_invoice_id":"","shipping_charge_tax":"","exchange_rate":"1.0","custom_fields":"[{\"field_id\":\"5693121000000111027\",\"customfield_id\":\"5693121000000111027\",\"show_in_store\":false,\"show_in_portal\":false,\"is_active\":true,\"index\":1,\"label\":\"Assessed Value\",\"show_on_pdf\":true,\"edit_on_portal\":false,\"edit_on_store\":false,\"api_name\":\"cf_assessed_value\",\"show_in_all_pdf\":true,\"value_formatted\":\"$10,000,000.00\",\"search_entity\":\"invoice\",\"data_type\":\"amount\",\"placeholder\":\"cf_assessed_value\",\"value\":1.0E7,\"is_dependent_field\":false},{\"field_id\":\"5693121000000111031\",\"customfield_id\":\"5693121000000111031\",\"show_in_store\":false,\"show_in_portal\":false,\"is_active\":true,\"index\":2,\"label\":\"Final Value\",\"show_on_pdf\":true,\"edit_on_portal\":false,\"edit_on_store\":false,\"api_name\":\"cf_final_value\",\"show_in_all_pdf\":true,\"value_formatted\":\"$100,000.00\",\"search_entity\":\"invoice\",\"data_type\":\"amount\",\"placeholder\":\"cf_final_value\",\"value\":100000,\"is_dependent_field\":false},{\"field_id\":\"5693121000000111043\",\"customfield_id\":\"5693121000000111043\",\"show_in_store\":false,\"show_in_portal\":false,\"is_active\":true,\"index\":3,\"label\":\"Tax Rate\",\"show_on_pdf\":true,\"edit_on_portal\":false,\"edit_on_store\":false,\"api_name\":\"cf_tax_rate\",\"show_in_all_pdf\":true,\"value_formatted\":\"1.85%\",\"search_entity\":\"invoice\",\"data_type\":\"percent\",\"placeholder\":\"cf_tax_rate\",\"value\":1.85,\"is_dependent_field\":false},{\"field_id\":\"5693121000000111051\",\"customfield_id\":\"5693121000000111051\",\"show_in_store\":false,\"show_in_portal\":false,\"is_active\":true,\"index\":4,\"label\":\"Easy Tax Protest Percent\",\"show_on_pdf\":true,\"edit_on_portal\":false,\"edit_on_store\":false,\"api_name\":\"cf_easy_tax_protest_fee\",\"show_in_all_pdf\":true,\"value_formatted\":\"25%\",\"search_entity\":\"invoice\",\"data_type\":\"percent\",\"placeholder\":\"cf_easy_tax_protest_fee\",\"value\":25,\"is_dependent_field\":false},{\"field_id\":\"5693121000000111055\",\"customfield_id\":\"5693121000000111055\",\"show_in_store\":false,\"show_in_portal\":false,\"is_active\":true,\"index\":5,\"label\":\"Invoiced Amount\",\"show_on_pdf\":true,\"edit_on_portal\":false,\"edit_on_store\":false,\"api_name\":\"cf_invoiced_amount\",\"show_in_all_pdf\":true,\"value_formatted\":\"$1.00\",\"search_entity\":\"invoice\",\"data_type\":\"amount\",\"placeholder\":\"cf_invoiced_amount\",\"value\":1,\"is_dependent_field\":false}]","estimate_id":"","shipping_charge_tax_exemption_id":"","shipping_charge_formatted":"$0.00","status_formatted":"Draft","reference_number":"","shipping_charge_tax_id":"","price_precision":"2","shipping_charge_account_id":"","shipping_charge_tax_percentage":"","adjustment":"0.0","shipping_charge_tax_name":"","status":"draft","due_date_formatted":"19 Dec 2024","tax_total":"0.0","adjustment_formatted":"$0.00","balance_formatted":"$0.00","shipping_charge_inclusive_of_tax_formatted":"$0.00","ach_payment_initiated":"false","payment_terms":"0","currency_code":"USD","shipping_charge_exclusive_of_tax":"0.0","total":"0.0","shipping_charge_exclusive_of_tax_formatted":"$0.00","tax_total_formatted":"$0.00","date_formatted":"19 Dec 2024","custom_field_hash":"{\"cf_invoiced_amount\":\"$1.00\",\"cf_easy_tax_protest_fee_unformatted\":25,\"cf_assessed_value\":\"$10,000,000.00\",\"cf_tax_rate\":\"1.85%\",\"cf_final_value\":\"$100,000.00\",\"cf_assessed_value_unformatted\":1.0E7,\"cf_final_value_unformatted\":100000,\"cf_invoiced_amount_unformatted\":1,\"cf_tax_rate_unformatted\":1.85,\"cf_easy_tax_protest_fee\":\"25%\"}","sub_total_formatted":"$0.00","shipping_address":"{\"zip\":\"\",\"country\":\"\",\"address\":\"\",\"city\":\"\",\"phone\":\"\",\"street\":\"\",\"attention\":\"\",\"street2\":\"\",\"state\":\"\",\"fax\":\"\"}","salesorders":"[]","shipping_charge_tax_formatted":"","shipping_charge_tax_type":"","currency_symbol":"$","due_date":"2024-12-19","shipping_charge_account_name":"","shipping_bills":"[]","payment_expected_date":"","salesperson_name":"","salesperson_id":"","shipping_charge":"0.0","deliverychallans":"[]","sub_total":"0.0","customer_name":"Capla Paprocki (Sample)","customer_id":"5693121000000104063","total_formatted":"$0.00","currency_id":"5693121000000000097","invoice_url":"https://zohosecurepay.com/books/easytaxprotestcom/secure?CInvoiceID=2-854572fa05a13029cb3fab0979e19423fc03f8b92474d85207c608f1b5b1402d68b7fa21be278db756d4d12a5338e9ffd618b1603607149470b563487343172211e80a707f5b3196 ","payment_terms_label":"Due On Receipt"}

Assessment Reduction: null

Tax Savings: null

Easy Tax Protest Fee: null

Assessed Value: null

Final Value: null

Tax Rate: null

ETP Fee: null

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      • Topic Participants

      • Jimmy

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

                                • workflow field update will Not triggering another workflow rule

                                  I have a Workflow rule that is supposed to get triggered when a field is modified to certain value. This field is actually the lead status and when the lead status changes to "Client Not Responding" . I have a series of emails that go out to re-engage
                                • [Résolu] Liste dynamique dans Creator

                                  Bonjour, Dans Zoho Creator j'aimera pouvoir afficher une liste en fonction d'une donnée choisie dans une autre liste. Explication : J'ai un formulaire Département avec comme champ : Nom J'ai un formulaire Personnel avec comme champs : Nom et 'lookup'
                                • PDF Document creating, editing, digital signing?

                                  Any chance you could provide PDF creating, editing,signing?  Or perhaps integrate with http://www.pdfescape.com/ ?   thanks, Linda
                                • Pay in USD

                                  Hi, is it possible to pay in USD instead of EUR? Thanks.
                                • Stock function not working for Brazil (Bovespa)

                                  Hi, The STOCK function in not working for the Brazil Exchange "Bovespa". This is the syntax I´m using: =STOCK("Bovespa:BBAS3";"PRICE"). Thanks for any help. Ale
                                • Tablet Pencil + Fillable Form

                                  Hi There, I just started using Zoho Writer Forms for our team on iOS. I noticed that some functions support 'scribble' or tablet pens and some do not. Is there a function I am missing where any text field can support 'scribble' or handwriting/printing
                                • Announcing new features in Trident for macOS (v.1.10.0)

                                  Hello everyone! Trident for macOS (v.1.10.0) is here with major features and enhancements to elevate your workplace communication and productivity. Let's take a quick look at them. Create tasks from emails. In addition to creating tasks from selected
                                • Journey : "Added to segment" trigger doesn't work automatically

                                  Hello, I’m experiencing an issue with our Marketing Automation 2.0 integration with Zoho CRM. We have multiple segments defined in Marketing Automation, each with criteria based on field values synced from Zoho CRM. If a field value changes in Zoho CRM,
                                • Assistance Required: Email Configuration Issues for Domain clearskyaerials.net

                                  Dear Support Team, I am experiencing issues with my email configuration after linking my domain, clearskyaerials.net, to Zoho Mail. I followed the DKIM setup guide and successfully configured it. While I can now send emails, I am unable to receive them.
                                • How can I bulk import product images to Zoho crm.

                                  How can I import product images to Zoho crm within bulk imports. I am using an excel sheet or csv and want to include an image (via URL) for each product. This topic is the closest I have found to a solution but I need further help to implement it: https://help.zoho.com/portal/en/community/topic/import-file-upload-and-image
                                • Can't send mail Reason:554 5.1.8 Email Outgoing Blocked.

                                  I send messages to my clients for my agency to my targeted clients last night I got (Unable to send message;Reason:554 5.1.8 Email Outgoing Blocked) this warning. Now I can't send mails. Please fix this issue.
                                • erro 553 retransmitindo e-mails não permitidos devido ao domínio ou algo parecido

                                  Olá, não consigo enviar ou receber e-mails, pois mostra uma mensagem de erro 553 retransmitindo e-mails não permitidos devido ao domínio ou algo parecido.. Por favor, ajude-me a corrigi-lo. Obrigado.
                                • How do I go to new form after using deluge button?

                                  I have (Form1) - [Report1] (Form2) - [Report2] I have created a button which appears on [Report1] which creates a new record for [Form2] using data from [Form1]. I have the script working well, it pulls the needed information from Form1 and builds a new
                                • smtppro.zoho.como eror

                                  En nuestras cuentas de empresa desde hace unos dias estamos experimientando problemas con los correos IMAP outlook, generando un error en el smtppro.zoho.com 465 /SSL Todo estaba trabajando bien y sin problemas. Alguien mas con el mimo problema y/o encontró
                                • Outgoing Email blocked

                                  Hi Support Team, My outgoing emails has been blocked, Appreciate your help to unblock it. Hartron Trade
                                • Sheet view ignores layout rules / How to restrict fields in sheet view

                                  Hi Problem 1: When editing records in sheet view, layout rules are ignored. This is a problem, because it allows users to ignore some mandatory fields (mandatory in a Layout Rule). (Mass Update does not allow updating of fields with Layout Rules, so why
                                • Portal users embed access

                                  So I have a page with a form, and two reports on either side. The reports are embedded as html snippets. So basically, it's set up that when I select a material from the form lookup field, it reloads the report embeds but filters the records with the
                                • Importing Accounts with Parent Accounts

                                  I would like to import accounts that contain parent accounts.  I see a Parent Account but do not see a Parent account number in the Zoho fields and will need this to make sure the correct unique parent is imported. Can you help explain how to accomplish this?
                                • Merge item

                                  As a follow up on a request point raised 7 years ago I would like to submit an official request to enable a "merge item" option. Discussion: https://help.zoho.com/portal/en/community/topic/merge-items submitted by user 4001007559351 Our business has several
                                • Canvas Fit to Screen

                                  Hi, is it possible to have the Fit to Screen tickbox unmarked as a default?
                                • Banking - User Roles - Access To Single Bank Account

                                  Hi, We have different locations with each location having a specific bank account for Expenses/Etc... Can you please confirm on whether it's possible to give a user (non accountant), specific access to only a single bank account as opposed to all accounts
                                • Zoho Account search not finding account even thought account is created

                                  Hi Over the last week I cannot find a account on a lookup field, the account exists as when I check in the module its there. Any lookup filter, in a lookup field fails to find the appropriate account, im not sure if you have a Regex issue but its clearly
                                • How to send an alert when there have been no leads for 2 days

                                  Hello, I want to be alerted when there have been no new leads created for, say, 2 days. It seems like it should be a simple thing to achieve but I'm struggling. I tried asking Zia and this was the answer, but it doesn't fit what I'm seeing on the workflow
                                • How to get bulk write to work as expected

                                  I need to move data from our systems into Zoho. I have created a sandbox to test the usage of migrating our data to Zoho and confirmed everything worked there. When attempting to do the same with our production CRM I was met with an error saying Zoho
                                • Zoho Sign embedded iframe

                                  Hello, we are looking for any of these options: a) some iframe that we can paste into our website for every signer, for onpage signing document. b) or get direct link for signers from Zoho sign API which we can redirect manually. Is any of these options
                                • SIGNATURE FIELD INSIDE CRM MODULE

                                  I need to have a signature field inside CRM MODULE This can be used into my Post Sales Module that i´ve created to make Meetings Summary I need my client to sign this Meetings Summary during my visit and that ain´t possible with Zoho crm I know we have
                                • email and username change

                                  HI, I'd like to change my email and username for my zoho store, please help me on this issue.
                                • "Extra keys limit has exceeded"

                                  Hello, Has anyone encountered the below message before in a workflow log failure: "Update Record Response is {\"code\":52,\"message\":\"Extra keys limit has exceeded\"}" The script is supposed to generate an invoice for a deposit when a deposit payment
                                • Collapsible Sections & Section Navigation Needed

                                  The flexibility of Zoho CRM has expanded greatly in the last few years, to the point that a leads module is now permissible to contain up to 350 fields. We don't use that many, but we are using 168 fields which are broken apart into 18 different sections.
                                • use of comma as a decimal separator

                                  Hello, I wish to find a way to customize the number format for my proper use. I have to use french data, where the "," is used as the decimal separator : for example the french way to write "3.99�" is "3,99�" Is it possible to do it in Zoho Sheet ? If this is not actually the case, I'd love this feature to be implemented !
                                • Zoho meeting api not working in trial version

                                  I have and free trial meeting access. When i have tried to create a authentication code for meeting it shows Invalid OAuth Scope error. My code: $client_id = 'client_id'; $redirect_uri = 'site_url'; $scope = 'ZohoMeeting.organize.CREATE,ZohoMeeting.organize.READ';
                                • Why is Nordic No Longer Available as a Translation Service for Email

                                  I routine receive email in Nordic but now it has been removed from the list of available translations. Why?
                                • Create WorkDrive Folder with specific Sub-Folders when new Zoho CRM entry in "Accounts" Module

                                  So, my flow creates a WorkDrive Folder in the required Team Folder, but I want the same flow to create four Subfolders within the new folder. Man, Woman, Boy & Girl sub-folders I was looking at this below but how do I identify the new Parent folder as
                                • Live webinar: 2024 recap of Zoho Show

                                  Hello all, 2024 has been an incredible year for Zoho Show! We've listened to your feedback and worked continuously to strengthen the tools you use to create, collaborate, and deliver presentations. From rolling out new features to enhancing existing ones,
                                • Changing Customer Currency

                                  It seems so silly that you can't change a customer's currency after a transaction is recorded. We work with companies all over the world and sometimes they might request an invoice in a different currency. To do this I have to create another customer
                                • Bulk payment of bills from multiple vendors

                                  Is there a way to pay multiple vendors bills in one transaction?  It appears that you have to deal with each one as a seperate transaction.  Is there a way to export the transactions to the bank using an ABA file?
                                • Line_Items not appearing in invoice arrays

                                  When i use the Zoho API to pull an invoice, it doesnt show the Line_items array... In the documentation it shows that it should appear but it does not. Is there any way to fix this?
                                • Active Customer List 2024

                                  Hello everybody, i am just a beginner :) how can i create a customer list of all active customer in 2024? Active customer means, all customers, who received an invoice in 2024 of us. Just tried already in CRM. Can i do that also in ZOHO books? I am looking
                                • Notifications on mentions in comments

                                  If another user mentions me (e.g. @mustafa... which autocompletes) in a comment on a ticket, how do I get notified? If I don't get notified, what on earth is the point of the mention feature???
                                • [New] Create invoices and contracts in minutes with Zoho Writer's Merge Templates for Bigin!

                                  Do you often find yourself manually entering customer information in your business documents like invoices and contracts? This can be a time-consuming process that can take up valuable time from your business operations. With Zoho Writer's Merge Templates
                                • Next Page