Accessing Custom Fields within Deluge Custom Button Script

Accessing Custom Fields within Deluge Custom Button Script

Hello, 

I am just getting started in customizing the Zoho Inventory App by adding custom buttons. I am trying to access custom fields that have been setup on the Purchase Order module with the following script: 

//This is a sample function. It will display the reference number
referenceNumber = purchaseorder.get("reference_number");
lotQty = purchaseorder.get("cf_number_of_lots");
resultMap = Map();
resultMap.put("message","Reference number -" + referenceNumber + ", Number Of Lots - " + lotQty);
resultMap.put("code",0);
// 0 - Success ; Other than 0 will consider as failure
return resultMap;

No matter what happens, the lotQty variable always comes back with Null. I've checked and the cf_number_of_lots is the API name of the custom field. 

Any help will be greatly appreciated. 

Jim      

    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


                                              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