Custom Function to get custom field of lookup type in Books

Custom Function to get custom field of lookup type in Books

Hi,

Here's the situation.

In Purchase Order, there is a custom field (lookup) to SO.
The requirement is to update to the related SO if PO get updated

Right now facing challenge to get the id of custom field (lookup) in PO.
Please find below the sample script:
info cfso; is the custom field, but return null

----------------------------------------------------------
----------------------------------------------------------

poID = purchaseorder.get("purchaseorder_id");

organizationID = organization.get("organization_id");

poinfo = zoho.books.getRecordsByID("purchaseorders",organizationID,poID,"zbooks").get("purchaseorder");

delivery_date = poinfo.get("delivery_date");

info delivery_date;

cfso = poinfo.get("cf_sales_order");

info cfso;

mplist = List();

mp = Map();

mp.put("api_name","cf_expected_delivery_date");

mp.put("value",delivery_date);

mplist.add(mp);

info mp;

json = Map();

json.put("custom_fields",mplist);

update = zoho.books.updateRecord("salesorders",organizationID,cfso,json,"zbooks");
----------------------------------------------------------
----------------------------------------------------------

Thanks

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


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








                                ご検討中の方