Custom Function to update Custom Field in Zoho Invoice

Custom Function to update Custom Field in Zoho Invoice

Hello, I need you help urgently. 
I would like to see Payment Method associated with the invoice in Zoho Invoice.

I have a custom field in Invoice Module called Payment Type. When I associate a payment with the invoice this field needs to be updated with the data from Payments Module - Payment Method.

Here is the code I wrote but couldn't make it work, need your help.

This is a custom function for payments module and will affect Invoice module.

payment = customer_payment.get("payment_mode");
invoice = List();
invoice = customer_payment.get("invoices").toList();
invoiceid = invoice.getJSON("invoice_id");
odeme = Map();
odeme = zoho.invoice.getRecordById("invoices",717534537,invoiceid).get("invoice").get("custom_field_hash");
odeme.update("cf_deme_tipi",payment);
zoho.invoice.update("invoices", 717534537, invoiceid, odeme);

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      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 コンテンツ




                              ご検討中の方