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

    • Topic Participants

    • Jimmy

    • Recent Topics

    • is it possible to pull the landing page and email campaign from Zoho app to Zoho marketing? Can I get all the benefits that exclusive app that offers in ZMA?

      There is a exclusive Zoho apps for landing page design, email campaign, and same features are there within ZMA as well for to setup landing page and email campaign. can ZMA offer all or limited features of those apps? I request please provide demo and
    • Enable 2FA / MFA in Bigin

      Hi, Our company started using Bigin. I (sysadmin) want to require MFA for Bigin as some users also have integrated their calender and mailbox into Bigin and regardless of that, in general, MFA logins are preferred in our company as it strengthens our
    • Forwarding Zoho Desk Support Email to a different e- mail

      Hello, I am using ZohoDesk and I have a Zoho Desk Support e-mail setup. I would like to know if there is a way to forward the e- mail inbound to this Zoho Desk Support e- mail to a different e- mail?  Thanks!
    • We are being overbilled by Zoho and they refuse to correct it

      We are being overbilled for CRM Ultimate Add-on. Zoho has acknowledged that they know this, but refuses to address and issue billing credits for the amounts we have been overpaying. Our company has been downsizing (unfortunately) and in the past 3 months
    • Does the ability exist to make tax on the customer profile mandatory?

      I am reaching out to inquire about the possibility of making the "Customer Tax" field mandatory when creating a new customer in Zoho. We want to ensure that all customers have their tax information recorded to maintain compliance with our internal processes.
    • Triggering rules on lead conversion

      There is no field on the Rule list for rule conversion to trigger an alert on liead conversion to a potential. I assigned a rule to file on any creation or update of a lead. The lead was changed a lead to a potential but no rule was fired. Rajesh Bhadra
    • How do you remove a user from SalesIQ?

      I have a user in Sales IQ who needs to be removed (she's no longer involved with sales and chat) but I can't find any way to remove her. How do I do that?
    • Integrate SalesIQ with tiendanube.com

      Tiendanube.com is the leading e-commerce platform designed to help businesses create and manage online stores. It provides tools for entrepreneurs and companies to set up, customize, and operate their online shops with ease. Tiendanube is particularly
    • How to reset Zoho Commerce

      Hi, we are preparing a new onlineshop connected to commerce and books for going live in the next days. Now we want to delete all tests and transactions we made within the development process. And also add a new tax rule which is not possible at the moment
    • Create Ticket from Chat with Rest API

      Hi to everyone, is possible to create a ticket from Chat with Rest API? In user interface is possible by clicking on the button "Convert chat as a ticket". Anyone know how to do that? Thanks
    • Free webinar: ‌Zoho Vault in 2024—A live Q&A with our experts

      Hi everyone! 2024 has been a pivotal year for us, taking our journey from a basic team password manager in 2013 to a full-featured security platform offering password management, single sign-on (SSO), and soon, passkey management. Our team has been tirelessly
    • Kaizen #167 - Configuration and Initialization of Zoho CRM Python SDK (V7) for different client types

      Hello everyone! Welcome back to another week of Kaizen! Zoho CRM Python SDK allows developers to integrate Python applications with Zoho CRM. In today's Kaizen post, we will explore how to initialize and configure the SDK for both self-clients and server-based
    • Zoho Forms - Dynamic Prefill Setup Question

      Hello, I'm very excited about this feature. So much I'm learning about webhooks. However, it seems that the webhooks I can obtain from Zoho Flow and Zoho CRM come with already parts in the URL that are put as invalid by the GET Webhook URL. Do I need
    • How to get a list of Team Folders associated to a Project from the API?

      I've tried the below, based on another article and was unsuccessful. response = invokeurl [ url :"https://projectsapi.zoho.com/api/v3/portal/" + _portalID + "/projects/" + _projectResID + "/folders" type :GET connection:"zohoprojects" ]; info response;
    • Email Alert attachments unavailable for Vendor Payments

      I have several vendors with country specific compliance requirements to support the payment of their invoices. I've created Vendor Payment templates to meet their requirements and I setup an automation workflow that gets triggered when the invoice is
    • How to create Sepa Direct Debit XML file: solution and code

      Even though Books provides a payment integration for Stripe and Gocardless (in Europe) there are customers that want to use the Sepa services of their own bank. Mainly because Stripe and Gocardless are quite expensive. In that case they would need a Sepa
    • Exporting Project Tasks

      I can export the gantt chart to a nice PDF in colour, but we want just the task list in a nice colour layout. Is there a way to export it to PDF without the gantt? It would be perfect to give to clients.
    • bug reporting with the count of linked Desk tickets

      I am aware that when viewing an individual bug, you are able to see a count of the Desk tickets that are linked to the bug on the right hand side. However, I cannot see a way of reporting this figure from a list of bugs. Our use case is that we would
    • Unable to send e-mails to an specific address

      Hello. I'm having problems sending e-mails to my shipping company. user@shippingcompanydomain.com INVALID_ADDRESS, ERROR_CODE :550, ERROR_CODE :5.1.1 <user@shippingcompanydomain.com>: Recipient address rejected: User unknown in virtual mailbox table Reporting-MTA:
    • Blueprint transition help needed

      I have 5 approvers. For a stage to be passed to the next stage, I require any 3 out of these 5 approvers to make the approval. There is no particular sequence of approval, at any one time, any one can approve. As long as 3 approvers approve, the stage
    • Year-End Wrap: Out-of-Office Made Easy with Zoho Mail

      As we wrap up 2024, now is the perfect moment to take control of your email routine and gear up yourself for a productive and successful new year. We have curated a series of weekly tips to help you master your email management starting today. Watch out
    • Creator Simplified #9: Automatically Sending Uploaded Files as Email Attachments

      Hey Creators, Welcome back to the Creator Simplified series! Today, we’ll explore how to automate file uploads as email attachments in Zoho Creator—a handy feature that saves time and reduces manual effort in your business processes. Use Case: In a typical
    • Zoho Books Community Meetup: Learn, Grow, Network!

      Hello users! We are excited to announce a series of upcoming Zoho User Group meetups and would love for you to join us! This is a great opportunity for you to connect with other users, share experiences, and learn more about how to make the most of our
    • Bar chart from Deal Stage Snapshot table not showing right amounts

      Hi, since we needed to track the changes of our deal pipeline over time, I added a new data source and selected 'Snapshots' to start the sync. At first I thought it was working just fine, after a few days I realized that something was wrong with the amounts
    • How to Display Territory Field on Deal Object

      I am assigning Territories to Deals. I am able to use the Territory field as a column in my list view but cannot figure out how to enable it to be visible when viewing a Deal record directly. Can you advise on how to display the territory assignment as
    • Power of Automation::Automate the process of creating Tasks from Task template on project status update.

      Hello Everyone, Here we are again to share another requirement that has been accomplished through the implementation of custom functions. A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed
    • Im Stuck in an EDIT ONLY WITH WIZARD issue

      So I found Wizards to be a really helpful tool in minimizing the exposure of redundant, superfluous fields to staff that would never otherwise have to edit those fields. My issue is, that when the record (in this case a lead) is created with a wizard,
    • Mass Update in Zoho CRM

      Hello, I want to update my past update records by using deluge on some conditions. anyone can please tell me how can I do it.
    • LinkedIn Followers not correct

      It looks like Zoho Analytics only counts followers from the day it was connected to our LinkedIn-page. The Total Followers Count in Analytics only displays 549 followers, while in reality we have 1,036 followers. The information is correct in Zoho Social,
    • [API] How to get Contact's funnel?

      Hi everyone! I am trying to use the API to get a Contact funnel's (step, name.. anything). Can anyone help me? This information is not available in the API response... I need to retrieve and change my Contacts between funnels dynamically according to
    • Task created from Email Alias

      When forwarding multiple emails to project email alias, it will create a task as internal which makes a lot of "General" Task List as I've created automation to set the flag as external. Is there any way to set up the task list created from email alias
    • Automation#24: Auto-Update custom field from Accounts to Tickets

      Hello Everyone! Welcome back to the Community Learning Series! This episode dives into how Zylker Techfix streamlines account-related ticket references. Previously, employees had to manually check account details to retrieve specific customer information,
    • How do I add an email to tasks in Trident?

      Hi, I'm trialling Trident to see if it works better for me than the browser version. It's a nice idea and looks quite refined, so I'd like to be able to use it. My first question is: how can I add and email to a task? I can't find any obvious way, but
    • Project template after project creation

      How can I apply a project template AFTER the project has been created?
    • Creating Email template that attaches file uploaded in specific field.

      If there's a way to do this using Zoho CRM's built-in features, then this has eluded me! I'm looking to create a workflow that automatically sends an email upon execution, and that email includes an attachment uploaded in a specific field. Email templates
    • Filter Tabs in a Dashboard

      I have multiple tabs in a dashboard one of which is aimed at a different audience, is it possible to filter out this tab for a group of users?
    • How do I set up Contact Scoring for my existing contacts

      I'm trying to set up Contact Scoring for my subscribers, 9 months after creating the database. I've added the Campaign Activities, but none of the contacts have a score. How can I update all the contacts so they show a score? My goal is to ultimately
    • ZOHO PEOPLE

      HOW CAN I DELETE LEAVE HISTORIES IN ZOHO PEOPLE?
    • Kiosk Studio: Function FIX for Date/Time Field (Keep getting wrong format error)

      I am using the foillowing function in my Kiosk Studio to update the previously entered Date/Time field from previous screen to update that to the same date/time field in Lead Record. Every time I 'Save & Execute' I get a Success but with 'Date/time Format
    • Zoho CRM Web To Lead Form: Radio Buttons/Pulll Down Menus?

      Hi is there a way to set up radio buttons, check boxes or pull down menus in the web to lead form? We often ask additional lead qualifiers or demographics information and in some cases radio buttons or pull down menus are necessary or more efficient to
    • Next Page