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

    Access your files securely from anywhere

          Zoho Developer Community




                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day



                                        Zoho Marketing Automation
                                            • Topic Participants

                                            • Jimmy



                                                Manage your brands on social media



                                                      Zoho TeamInbox Resources

                                                        Zoho DataPrep Resources



                                                          Zoho CRM Plus Resources

                                                            Zoho Books Resources


                                                              Zoho Subscriptions Resources

                                                                Zoho Projects Resources


                                                                  Zoho Sprints Resources


                                                                    Qntrl Resources


                                                                      Zoho Creator Resources



                                                                          Zoho Campaigns Resources


                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

                                                                                    Writer is a powerful online word processor, designed for collaborative work.

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Immediate action required by Notification SMS users

                                                                                                    Attention dear customers, This announcement seeks immediate action by CRM Notification SMS users to update their telemarketer aggregator for notification SMS compliance. We would like to bring to your attention an important update in the Telecom Regulatory
                                                                                                  • Import subform entries conveniently in CRM

                                                                                                    Dear All,   Subforms have always been crucial for associating additional data with CRM records. You can easily associate line items with parent records and keep track of various details related to your records. We're pleased to announce that we've introduced
                                                                                                  • Pay milage expense with undepositied cash

                                                                                                    Hello When I add millage, the only probable option to "pay through" is Owner's Equity. I pay for the fuel using undeposited cash but I can set "paid through" to undeposited funds while entering mileage. I do not have employees and this is the mileage
                                                                                                  • Inconsistent "Happiness Rating" Percentage

                                                                                                    When searching through the list of customers, the Happiness Rating percentage that shows for one particular customer of ours is 71%. However when going into that customer, the percentage shows as 100% (which we think is correct as we can't find anything
                                                                                                  • Zoho Desk - how to see date ticket created?

                                                                                                    We have migrated from Help Scout and are a customer service team, not a technical ticket team. (i.e. we don't have 'due in X hours' needs) We are accustomed to seeing the date the customer sent the email / ticket received. I don't see a way to display this very basic information in the Views. Please assist with how to display this.
                                                                                                  • Not able to create a new, second help center

                                                                                                    Hi. I'm not able to create a new, second help center. How can I solve this problem?
                                                                                                  • Contacts and Accounts views support and Ticket details screen UI enhancement - Zoho Desk Android app update

                                                                                                    Hello, everyone! In the latest version(2.7) of the Zoho Desk Android app update, we have covered the following features: Contacts and Account views UI enhancement in the Ticket details screen IM icon display Contacts and Accounts view You can now access
                                                                                                  • Enable 'drag & drop' upload of files to Purchase Receives

                                                                                                    Zoho has enabled drag and drop functionality for sales orders and purchase orders in Zoho Books. Currently this functionality is not enabled for Purchase Receives, which require you to "upload your files" via the file manager rather than simply dragging
                                                                                                  • SSL Certificate Error - Connection is not secure

                                                                                                    I am new to Zoho Desk, but I've tried to link our new Zoho helpdesk to our domain via the subdomain https://helpdesk.leannova.de It appears the CNAME change we implemented is working, but we're getting an SSL error that looks like this: *********************************** Your connection isn't private Attackers might be trying to steal your information from helpdesk.leannova.de (for example, passwords, messages, or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID This server couldn't prove that it's
                                                                                                  • Log when ticket is moved to a different department

                                                                                                    Hello, is there a way that I am able to log when and who moved a ticket from one department to another? I tried looking at workflows and I can't find any way to log a history when a ticket's department is changed. It would be great if this data could
                                                                                                  • SMTP Error: Could not authenticate.

                                                                                                    Hi team! Trying to send email throu PHPmailer. Im using smtp.zoho.eu, TLS with port 587. Username: alex@aljon.nu Password: *********** (well, my login password). This is the error: 2017-12-19 13:06:49 SERVER -> CLIENT: 220 mx.zoho.eu SMTP Server ready
                                                                                                  • 554 5.2.3 MailPolicy violation Error, help?

                                                                                                    This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. 554 5.2.3 MailPolicy violation Error delivering to mailboxes I am not sure why i am getting this, please
                                                                                                  • Recover trash emails deleted by Zoho

                                                                                                    Three times in the past 6 weeks all emails have been deleted from trash. I have NOT accidentally deleted them myself--they literally disappear before my eyes. I have the trash folder set up to delete items after 30 days, but they have suddenly ALL disappeared
                                                                                                  • ERROR:554 5.1.8 Email Outgoing Blocked.

                                                                                                    Buen día Tengo un problema con una de mis cuentas de correo corporativo, investigue sobre el error, borre mensajes y el problema persiste. No se como puedo desbloquear mi cuenta de correo. El correo en cuestión es dinagramascentro@servicioslatinosltda.co
                                                                                                  • ME SALE ESTE ERROR: No fue posible enviar el mensaje;Motivo:554 5.1.8 Email Outgoing Blocked

                                                                                                    Ayuda!! Me sale este error al intentar enviar mensajes desde mi correo electronico de Zoho! Tampoco recibo correos pues cuando me envia rebotan. Ayuda, Me urge enviar unos correo importantes!! Quedo atenta MAGDA HERNANDEZ +5731120888408
                                                                                                  • Custom Button in Shipments

                                                                                                    Custom buttons feature is very much needed in shipments. Please work on this feature request!
                                                                                                  • Zoho mail is logging me out almost every day ?

                                                                                                    Yes I have clicked the Remember Me option. Yet I need to login again every 1 - 2 days, sometimes multiple times per day. The saved credential does not persist.  Using fairly clean Chrome.
                                                                                                  • Asap Widget 2.0

                                                                                                    Where's the documentation for the new ASAP widget? https://www.zoho.com/desk/developers/asap/#introduction this one is outdated How can we dynamically navigate between different views? How can we prefill ticket forms using ASAP 2.0?
                                                                                                  • DataPrep Bigquery Connection failed

                                                                                                    Hello everybody, I want to create a connnection beetwen Bigquery and Dataprep but when I try to connect my project I got this error Loading tables has failed. Table list fetched from the data source expired.
                                                                                                  • Can I add Conditional merge tags on my Templates?

                                                                                                    Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
                                                                                                  • Organization-Tiered Support in Zoho Corp Help Center

                                                                                                    Dear Zoho Team, Greetings! As the focal point for all Zoho-related matters in our organization, we would like to request the implementation of an organization-tiered support structure in the Zoho Corp Help Center (Zoho's internal Zoho Desk). This feature
                                                                                                  • HTTP Error 500 when creating E-Mail Draft with API

                                                                                                    Hi, I tried to create an email draft for a ticket using the Zoho Desk API (v1); however, I continuously receive HTTP Error 500: An internal server error occurred while performing this operation. I've tried both curl and Python implementations, but neither
                                                                                                  • Recording overpayment?

                                                                                                    So a customer just overpaid me and how do I record this? I can't enter an amount that is higher than the invoice amount. Eg. Invoice is $195 and he sent $200. He's a reccuring customer so is there a way to record so that he has a $5 advance for future invoice?
                                                                                                  • Function #10: Update item prices automatically based on the last transaction created

                                                                                                    In businesses, item prices are not always fixed and can fluctuate due to various factors. If you find yourself manually adjusting the item rates every time they change, we have the ideal time-saving solution for you. In today's post, we bring you custom
                                                                                                  • Calculate BMI

                                                                                                    Hello, Could you please help me with the following calculation: Height registration is in feet & inches. Weight registration is in pounds & LBS. I want to calculate the BMI for example: //Calculate pounds dec = row.Today_s_Weight_st_lbs.toDecimal() * 100; num = row.Today_s_Weight_st_lbs.toLong() * 14; pounds = (dec +  num); //Calculate inches dec1 = X.Height_ft_ins.toDecimal() * 100; num1 = X.Height_ft_ins.toLong() * 12; inches = (num1 + dec1); //BMI Calculation row.BMI = (pounds  *  0.45)  /  ((inches
                                                                                                  • Zoho Recruit - Blueprint and ZIA

                                                                                                    If I activate the Blueprint for Jobs in Zoho Recruit, Zia disappears for matching canddiates, why is that?
                                                                                                  • E-mails duplicados

                                                                                                    Ao enviar e-mails, uma das contas de nossos usuários, mostra dois e-mails enviados iguais. Como faço para exibir somente um e-mail enviado? Obrigado,
                                                                                                  • Zoho Creator - Install app from Gallery takes too long

                                                                                                    I'm trying to install the 'Volunteer Portal' from the app Gallery of Zoho Creator. It has been busy installing the app for over 2 hours now. It might be okay, but how long is something like that supposed to take? I never installed anything from that Gallery
                                                                                                  • Why Trident?

                                                                                                    Maybe a strange question, but I was wondering why Trident is being developed. It looks fine and is working better and better, but I can't see what you want to achieve what isn't already in Zoho Mail? Zoho mail is already an (webbased I suppose) app that
                                                                                                  • Email não baixa nem anexa arquivos

                                                                                                    Boa tarde. Não consigo baixar, visualizar nem anexar arquivos no e-mail Zoho. Já baixei a permissão para o Chrome, mas não adiantou. Tentamos no Windows 7 e 10, e mesmo assim não baixa nada. Somente pelo app do celular consigo baixar. O que posso fazer?
                                                                                                  • Email zoho não baixa nem anexa arquivos

                                                                                                    Não consigo baixar, visualizar nem anexar arquivos no e-mail Zoho. Já baixei a permissão para o Chrome, mas não adiantou. Não baixa nada. Somente pelo app do celular consigo baixar. :(
                                                                                                  • Problem adding emails to my account / Email Address already exists or associated in another Organisation

                                                                                                    Hello, I am trying to create 3 emails that I previously deleted, but it gives me the message that you see on the screen below, I tried to write to support but I still have no response, what else can I do?
                                                                                                  • "Processing"

                                                                                                    Hi, All emails outgoing are showing "processing", any issues? Thanks
                                                                                                  • Auto forward after moving email from spam to inbox

                                                                                                    Auto forward is generally working fine, however it does not forward mails landed in the spam folder. I can move important mails from spam back to inbox, is it possible to automatically forward them once they are in inbox? Obviously I can manually forward
                                                                                                  • Projects Task List Bars not Showing

                                                                                                    Im in my Projects template and the grey bar for the Task Lists is not showing and the tasks cannot join to it. I have it open in a job and it works. Anyone know why its not showing in the template?
                                                                                                  • Restriction in assigning signer fields for the "Approver" role in APIs and internal integrations

                                                                                                    Hi, Zoho Sign's intended design is offering two actions to the recipient - Needs to sign (if you wish your recipient to add information to the document; signature, for instance) or Approver (someone who has to approve the content of the document and must
                                                                                                  • Searching Notes & Attachments

                                                                                                    Is it possible to have the search in CRM search the Notes and Attachments for key words
                                                                                                  • no me llegan los correos a Zoho mail

                                                                                                    No puedo recibir correos pero sí enviarlos, ya hice la modificación de MX y la verificación de teléfonos, qué es lo que ocurre? gracias
                                                                                                  • 553 Relaying disallowed SMTP Error: data not accepted

                                                                                                    I am configuring my website to use my zoho mail for my contact form. I am using phpmailer but this exits with the following error: SMTP ERROR: DATA END command failed: 553 Relaying disallowed SMTP Error: data not accepted. Mailer Error: SMTP Error: data
                                                                                                  • Rebrand your CRM with the all-new custom domain mapping setup

                                                                                                    UPDATES TO THIS FEATURE! 19th Jan, 2024 — Custom domain mapping has been made available for portal users in Zoho One and CRM Plus. 23rd June, 2023 — Custom domain mapping has been made available for all users, in all DCs. Hello everyone! We are elated
                                                                                                  • Next Page