Zoho CRM Workflow Function Not Receiving Field Data – All Values NULL

Zoho CRM Workflow Function Not Receiving Field Data – All Values NULL

Hi Everyone,

I am trying to do an automation using function and workflow.

One of our client has a request that they want to get an update about all of their sales order on their application when the status of sales order change. I created a work flow rules, crete and edit and if the account name is "client account name", then apply the function. 


An automated category functuion is created to send
webhook url. later will be replaced by clients standard Mule Rest Callout with auth2.0 authentication.

my response is success but no data is sent all logs are showing data point is null. I have fot the fields name and API name from Zoho API names only.

Info
  • 🔍 Function Execution Started
  • Received SO Number: NULL
  • Received Status: NULL
  • Received Deal Name: NULL
  • Received Contact Name: NULL
  • Received Account Name: NULL or Empty
  • string standalone.sendSalesOrderToMule(Int sales_order_id)
  • {
  • // Fetch Sales Order details from Zoho CRM
  • sales_order = zoho.crm.getRecordById("SalesOrders",sales_order_id);
  • // Check if the Account Name is "Aldar Properties"
  • account_name = sales_order.get("Account_Name");
  • if(account_name != "Aldar Properties")
  • {
  • return "No action taken - Not Aldar Properties";
  • }
  • // Extract required fields
  • so_number = sales_order.get("SO_Number");
  • status = sales_order.get("Status");
  • deal_name = sales_order.get("Deal_Name");
  • contact_name = sales_order.get("Contact_Name");
  • // Prepare JSON payload
  • data_map = Map();
  • data_map.put("so_number",so_number);
  • data_map.put("status",status);
  • data_map.put("deal_name",deal_name);
  • data_map.put("contact_name",contact_name);
  • // Convert Map to JSON string
  • json_payload = data_map.toString();
  • // Ensures proper JSON format
  • // Define Webhook URL (For now, we use a dummy API for testing)
  • webhook_url = "https://httpbin.org/post";
  • // 🔄 Replace with MuleSoft API later
  • // Send POST request
  • response = invokeurl
  • [
  • url :webhook_url
  • type :POST
  • parameters:json_payload
  • headers:{"Content-Type":"application/json"}
  • ];
  • // Log response for debugging
  • info response;
  • // Return success message
  • return "Webhook sent successfully!";
  • }
  • ❌ Error: Account Name is empty!

    • Sticky Posts

    • Function #46: Auto-Calculate Sales Margin on a Quote

      Welcome back everyone! Last week's function was about displaying the discount amount in words. This week, it's going to be about automatically calculating the sales margin for a particular quote, sales order or an invoice. Business scenario Where there is sales, there's also evaluation and competition between sales reps. A healthy rivalry helps to better motivate your employees to do smart work and close deals faster and more efficiently. But how does a sales rep get evaluated? 90% of the time, it's
    • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

      Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
    • User Tips: Auto-Create Opportunity/Deal upon Quote Save (PART 1)

      Problem: We use quotes which convert to sales orders but Users / Sales Reps do not create opportunities / deals and go straight to creating a quote. This leads to poor reporting. Implementing this solution improves reporting and makes it easier for users.
    • Custom Function : Automatically send the Quote to the related contact

      Scenario: Automatically send the Quote to the related contact.  We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually. We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email. Please note that the quote will be sent as an inline email content and not as a PDF attachment. Please follow
    • 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