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

                                • Create Invoice With More Than One Item/Product

                                  I was trying to use Zoho Flow to automatically create an invoice when an opportunity is marked won in Zoho CRM. However, you can only add one item/product using the Create invoice module. Is it possible to add more than one item/product to the same invoice?
                                • Formulae field(Sum) not updating when a sub form entry is deleted

                                  Hi there, I was facing this issue wherein I have a main form called 'Work_order_Form' and in that main form I have a sub form called 'Items' and in that items I have a field called 'Print_Charges'. So in my main form I have a formulae field which calculates
                                • Regarding the integration of Apollo.io with Zoho crm.

                                  I have been seeing for the last 3 months that your Apollo.io beta version is available in Zoho Flow, and this application has not gone live yet. We requested this 2 months ago, but you guys said that 'we are working on it,' and when we search on Google
                                • Count of Distinct IDs when they appear multiple times within a selected time period

                                  I have a transactions table which includes the columns: date, customer_id and order_id. I want to be able to count the distinct customer_ids within a date range when those customer_ids appear across multiple rows (because they have multiple orders within
                                • How do I append customer number to invoice number?

                                  New Zoho Books customer using the free trial and trying to figure out how to append the customer number to the invoice number. For example, my customer number is: ACME My current invoice number is: 24-XXX I would like my invoice number to be: ACME-24-XXXX
                                • Double spacing issues in Zoho Mail

                                  Some of my emails are double spacing and others our single space very anoying, wanted to know how to fix the problem. Also, can't get my signiyure on my emails to be singled space someone please help!!!!!
                                • Have an input card for zobot that could collect Name, Email, and Phone or a message all at once

                                  It would be great to have an input card for the codeless bot in a form style that allows it to ask all relevant questions at once. at any point in the chat flow or conversation, This approach would simplify the interaction, making it easier and more straightforward
                                • Webhook Failure Alerts and Retry Mechanism

                                  Dear Zoho Team, I have a workflow in Zoho CRM that sends a webhook whenever a specific field is updated. Occasionally, the workflow fails, and I can manually check the errors under Settings > Automation > Actions > Webhook > Failures. However, these failures
                                • Zoho CRM not saving edited quotes

                                  When I am editing existing quotes, zoho CRM often gets stuck and I see only the red circle with line through it when I try to save my edits for that quote. This is destroying my workday. Help please!
                                • Introducing the Zoho Sign and Bigin integration

                                  Greetings, We're thrilled to announce that Zoho Sign has integrated with Bigin by Zoho CRM, bringing a seamless signing experience directly into your small business CRM. You can now sign, send, and manage your contracts and agreements directly from your
                                • Zoho Survey Partially Completed Send Reminder to Complete the Survey

                                  I have couple of survey's set up through a link webform. These survey's are not being distributed through email, only a website link. We get more than 50% partially completing the survey. Is there a way to send an email to these people? I looked under
                                • Dynamic Variables for Organization Names in Forms and Emails

                                  I’m currently using your platform to distribute a standardized questionnaire to various organizations, and I would like to make the experience feel more tailored to each recipient. Specifically, I’m wondering if it is possible to use a dynamic variable
                                • Migrate from crm plus a zoho

                                  Hello, it turns out that I migrated my account from CRM Plus to Zoho One on the same administrative license, and when I reviewed what CRM, Desk and Sales are, IQ they are with another organization, I do not migrate, for example I enter CRM and I can see
                                • Custom Modules - Zoho Desk - iOS

                                  Hello, everyone! In the iOS version(v2.8.9) of the Zoho Desk mobile app, we have introduced support for custom modules as a related item to the standard modules like Tickets, Contacts, and Accounts. This new feature allows you to capture unique information
                                • Update Candidate Status Through Workflow in Blueprint

                                  Hi Team,  We have a blueprint built out with custom functions that update particular fields based on candidate actions. When particular fields are updated we need to move the candidate forward in the blueprint. We tried to do this through a workflow,
                                • QR Code generation - native

                                  All, FYI Google have recently depreciated their QR Code API refer: https://stackoverflow.com/questions/55021765/deprecation-of-google-infographics-qr-codes Annoyingly, this has meant we needed to change our links over to another provider. Creator team:
                                • Double Value in KPI - Zoho Analytics

                                  Hi Team, I tried to implement this in Zoho Analytics but couldn't figure it out. Here's the scenario: I want to display the total number of tickets created, along with the count of closed and in-progress tickets, all in a single KPI. How can I achieve
                                • Rich-text fields in Zoho CRM

                                  Hello everyone, We're thrilled to announce an important enhancement that will significantly enhance the readability and formatting capabilities of your information: rich text options for multi-line fields. With this update, you can now enjoy a more versatile
                                • Archiving Contacts

                                  How do I archive a list of contacts, or individual contacts?
                                • Change default identifier field in custom module

                                  Hi, i have searched through several community posts and helpdesk articles but i have not been able to find a proper solution for our problem yet. We have created a new module which aims to provide similar functionality as the default "accounts" module.
                                • Unveiling Cadences: Redefining CRM interactions with automated sequential follow-ups

                                  Last modified on 01/04/2024: Cadences is now available for all Zoho CRM users in all data centres (DCs). Note that it was previously an early access feature, available only upon request, and was also known as Cadences Studio. As of April 1, 2024, it's
                                • Zoho Books - Branches - Can I cross-charge between branches?

                                  Hi,  We have two parts of our company, manufacturing and sales. The manufacturing side will invoice/bill the sales side for the materials and labour on each order.  I have recently discovered the Branches feature in Books and it fits well with our set
                                • Books Custom function - Not executing..

                                  Use case : Module involved = Invoice When an Invoice is "Approved", the "current date" is more than "n" days and the "Amount" to be received is more than 0 I want a cliq message to be triggered in a channel and to be executed Daily(Scheduled) at 10:30
                                • Delete Transactions in Zoho books

                                  Hi, Zoho books have been migrated from 01.04.2023. However, there are few transactions passed for the period 01.04.2022 to 31.03.2023. I would like to delete all the entries passed during that period. Can you please help in deleting the same.
                                • Generate access token(Google OAuth 2.0) dynamically using deluge

                                  How to generate Google OAuth 2.0 access token dynamically using deluge to Add the zoho books invoice data in google spread sheet.
                                • Placeholders for Multi-Level Discount

                                  I am using custom templates for Invoices and all other modules. Since i have activated multi-level discount (an early-access feature from zoho) "discount at line-item and transaction level", I need placeholders for using them in my custom templates. With
                                • Power of Automation: Streamline status update for linked issues.

                                  Hello Everyone, A Custom Function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as to when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. We have
                                • How to have two separate views for different countries

                                  Hi there, currently i have two offices i want to add to zoho crm, one office is in singapore which i have already implemented fully. The other office being malaysia which i want to implement. One issue with this is we want the malaysia office users to
                                • Ticket View Across Departments

                                  I setup departments for the main clients I service, tickets inbound from specific emails go right to the departments. This helps with reporting for me. I would like a view of tickets assigned to agent, or unassigned, across ALL departments. Basically I am handling tickets across 3 departments, but I have to keep switching to see what tickets i have. I would like a view where I look and see ALL tickets across ALL departments.
                                • Merging 2 tickets

                                  Hi I understand how to merge 2 tickets already but find the process quite cumbersome. It is not always simple to perform a search that causes the 2 tickets in question to show up on the Ticket Screen, and this is the only place a merge can be performed. Doing a search for the customer or contact linked to the ticket displays all of their tickets which could be hundreds to sort through, you could do a custom search that only shows open tickets but doing that every time is also time consuming. Not
                                • Emailing a document to WorkDrive

                                  Does WorkDrive include the ability to upload a document by sending an attachment to an email address? (Books and Expenses include this functionality) If it doesn't is it under consideration? on the Road Map?
                                • 【開催報告】 東京 ユーザー交流会 2024/11/29(金) Zoho Oneを活用した社内DX推進事例の共有

                                  皆さま、こんにちは。コミュニティチームの藤澤です。 11/29(金)に東京ユーザー交流会を開催しました。10月の開催回に引き続き、多くのユーザーさんに参加いただきました!以下に各セッションの概要と登壇資料も掲載しています。ぜひご参照ください。 Zoho活用事例セッション:Zoho Oneで決め打ちDX~導入過程からコスパ・タイパを極めて効率化~ 今回は、株式会社T h e F l o wの若林さんに登壇いただき、Zoho One を活用した社内DX推進のことや、そもそも「DXとは何か?」というようなDXの本質に迫った内容まで多岐にお話しいただきました。以下に当日の発表内容と資料を一部抜粋して記載しています。
                                • Product Request: Send email to Secondary email

                                  Guys, we should be able to send the campaign to the secondary email too.  Is this on the plans for Zoho Campaign? It looks like I can map the secondary email from the CRM to the Campaigs, but can not send the message.  
                                • Logic for sending to a non-primary email address

                                  Hi, I have a scenario where contacts are able to sign up for emails with 2 different email addresses (example: work, personal). I've mapped both to Campaigns from Zoho CRM, but when I go to target an email only the primary email addresses are pulling in. How can I update this to look at both of the email addresses - or specifically the secondary email address in Campaigns? Thanks, Jenny
                                • Ticket Status Colors

                                  Can i change the colors of Ticket Status in the admin panel?  Or even change the background of the entire cell of a Critical ticket?  This way its easy for my agents to see a urgent ticket when it comes in.  Right now everything is black text. Here Right
                                • Zoho Sites and CloudFlare DNS issue over HTTPS

                                  I have a Zoho Site with a custom domain voterprotectioncorps.org NameCheap is the registrar CloudFlare is the DNS manager, using custom Nameservers (see attached) I installed the SSL cert via Zoho Sites (the "Add SSL cert" option that installs the free
                                • How do I do a formula to join two fields together like first name and last name into full name?

                                  Having issues with this in my custom module.  In most CRM systems you would do: FIELD1 & " " & FIELD2 But it gives an error saying I'm not supposed to use double quotations so not sure what that means.  I've tried to read the formula help guide but it's
                                • 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
                                • Next Page