Custom Related List Inside Zoho Books

Custom Related List Inside Zoho Books

Hello, We can create the Related list inside the zoho books by the deluge code, I am sharing the reference code Please have a look may be it will help you.
  1. //..........Get Org Details
  2. organizationID = organization.get("organization_id");
  3. Recordid = cm_g_a_data.get("module_record_id");
  4. // Record Data.........
  5. recordyear = cm_g_a_data.get("cf_date").getPrefix("-");
  6. amount = cm_g_a_data.get("cf_amount");
  7. resvp = zoho.books.getRecordsByID("cm_g_a_data",organizationID,Recordid,"zohobooks");
  8. if(resvp.get("code") == 0)
  9. {
  10. Expense_Account = ifnull(resvp.get("module_record_hash").get("cf_expense_account_formatted"),"");
  11. }
  12. // Budget Data..........
  13. budgestdata = invokeurl
  14. [
  15. url :"https://books.zoho.com/api/v3/budgets?organization_id=" + organizationID
  16. type :GET
  17. connection:"zohobooks"
  18. ];
  19. lis1 = List();
  20. taglist = List();
  21. if(budgestdata.get("budgets").size() > 0)
  22. {
  23. for each  rec in budgestdata.get("budgets")
  24. {
  25. if(recordyear == rec.get("year"))
  26. {
  27. budgetYear = rec.get("year");
  28. taglist.add(rec.get("tag_option_name"));
  29. lis1.add(budgetYear);
  30. }
  31. }
  32. }
  33. if(lis1.size() > 1)
  34. {
  35. finalamount = (amount / lis1.size()).round(2);
  36. }
  37. else
  38. {
  39. finalamount = amount;
  40. }
  41. //.........Coloumn Name
  42. headerData = List();
  43. headerData.add({"key":"Expense_Account","value":"Expense Account"});
  44. headerData.add({"key":"Tag_Name","value":"Tag Name"});
  45. headerData.add({"key":"Ammount","value":"Ammount"});
  46. listData = List();
  47. for each  rec1 in taglist
  48. {
  49. details = Map();
  50. if(rec1 == "General & Administration")
  51. {
  52. details.put("Expense_Account",ifnull(Expense_Account,""));
  53. }
  54. else
  55. {
  56. details.put("Expense_Account",ifnull("G & A",""));
  57. }
  58. details.put("Tag_Name",ifnull(rec1,""));
  59. details.put("Ammount",ifnull(finalamount,0.00));
  60. listData.add(details);
  61. }
  62. //....... Final Data
  63. resultMap = Map();
  64. resultMap.put("header_context",headerData);
  65. resultMap.put("data",listData);
  66. return resultMap;
Thanks & Regards
Piyush Goyal
Zoho Developer
+91-8619164837

    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator 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

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方