Trying to create a custom function that creates a sales order in zoho books after its created and approved in zoho crm

Trying to create a custom function that creates a sales order in zoho books after its created and approved in zoho crm

tried to use the code below to create sales order in zoho books after its created and approved in zoho crm
but am getting the error
//error
Failed to save the function
Not able to find 'getRecordsByID' function Line Number: 3

salesorderID =salesorder.get("salesorder_id");
organizationID = organization.get("organization_id");
data = zoho.crm.getRecordsByID("Salesorders",organizationID,salesorderID);
//info data;
sale = data.get("salesorder").toMap();
productitems = sale.get("line_items").toJSONList();
subtotal = 0.0;
pdlist = List();
for each r in productitems
{
name = r.getJSON("name");
rate = r.getJSON("rate");
quantity = r.getJSON("quantity");
item_total = r.getJSON("item_total").toDecimal();
zohobooksPro = zoho.books.searchRecords("Products","(Product_Name:equals:" + name + ")");
for each ele in crmPro
{
proID = ele.get("id");
}
pro=map();
pro.put("product",{"name":name,"id":proID});
pro.put("quantity",quantity.toLong());
pro.put("list_price",rate.toDecimal());
pro.put("total",item_total.toDecimal());
pro.put("net_total",item_total.toDecimal());
pdlist.add(pro);
}
mp = Map();
mp.put("Subject",sale.get("customer_name"));
mp.put("Account Name",sale.get("customer_name"));
mp.put("Currency", sale.get("currency_code"));
mp.put("Carrier",sale.get("delivery_method"));
billing_address = sale.get("billing_address").toMap();
mp.put("Billing Street",billing_address.get("address"));
mp.put("Billing City",billing_address.get("city"));
mp.put("Billing State",billing_address.get("state"));
mp.put("Billing Code",billing_address.get("zip"));
mp.put("Billing Country",billing_address.get("country"));
shipping_address = sale.get("shipping_address").toMap();
mp.put("Shipping Street",shipping_address.get("address"));
mp.put("Shipping City",shipping_address.get("city"));
mp.put("Shipping State",shipping_address.get("state"));
mp.put("Shipping Code",shipping_address.get("zip"));
mp.put("Shipping Country",shipping_address.get("country"));
mp.put("Salesperson name",sale.get("salesperson_name"));
mp.put("Status",sale.get("status"));
mp.put("Product_Details", pdlist);
c = zoho.books.createRecord("Sales_Orders",mp);
info c;

    • Sticky Posts

    • Function #50: Schedule Calls to records

      Welcome back everyone! Last week's function was about changing ownership of multiple records concurrently. This week, it's going to be about scheduling calls for records in various modules. Business scenario Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly. CRM
    • Custom Function: Tracking the Case Closed time

      Scenario: Tracking the Case Closed time   We create cases and close them but how do we keep track of the details on when the case was closed? This custom function helps you track the closed time of a case, in a custom date-time field. You can then generate reports based on the closed time. You need to have a custom date time field to update the Closed Time. Please follow these steps: Log in to Zoho CRM with administrative privileges. Click Setup > Automation > Workflow > Create Rule. In the New Rule
    • Function-2: Round-Robin assignment of records

      Welcome back folks! Last week, we saw how to update sales commission in quotes using a custom function. This week, let's see an interesting use case asked by many of you - auto-assignment records by round-robin method. Business scenario: Right now, the solution allows you to auto-assign leads from web form and imported lists. Let us look at a need where you want to auto-assign leads from in-bound calls in a round-robin method, across modules. Prerequisite: You must create a permanent record in the
    • Function #37: Create a Purchase Order from a Quote

      Welcome back everyone! Last week, we learnt how to calculate the total number of activities for a lead and further take note of the activity count for particular dates. For instance, from the period of Demo to Negotiation. This week, let's look at a function that lets you create a Purchase Order instantly from a Quote. Business scenario: In any form of business, one of the most important things to do is to document the transactions. Naturally, negotiation, signing an agreement, placing an order,
    • Function-1: Compute and update sales commission in quotes.

        Welcome back folks! In this week's custom functions series, we've picked a requirement that has often been asked by users! Business requirement: In most sales organizations, commissions are an integral part of the extrinsic rewards program, contributing significantly to the sales person’s compensation package. Sales commission is usually calculated as a percentage of revenue generated by the sales person. What if your sales team is enabled with an option to check their sales commission associated

    Zoho Pagesense Resources

        Zoho SalesIQ Resources



              Zoho TeamInbox Resources

                Zoho DataPrep Resources


                    Zoho CRM Plus Resources

                      Zoho Books Resources


                        Zoho Subscriptions Resources

                          Zoho Desk Resources

                            Zoho Projects Resources


                              Zoho Sprints Resources


                                Qntrl Resources


                                  Zoho Creator Resources


                                    Zoho WorkDrive Resources




                                        Zoho Campaigns Resources

                                          Zoho CRM Resources

                                                      Design. Discuss. Deliver.

                                                      Create visually engaging stories with Zoho Show.

                                                      Get Started Now