Function working while editing, not as a button

Function working while editing, not as a button

I have a function that is using information from a Sales Order.  I have an argument passing the Sales Order ID (as SO_Number) to the function which I use to look up the Sales Order like this:

condition = "(SO_Number:equals:" + SO_Number.toString() + ")";
mySalesOrder = zoho.crm.searchRecords("Sales_Orders",condition);
...
Do a bunch of stuff
....


The thing is, when I'm editing the function and I use the "Save and Execute" button and I enter a valid Sales Order ID manually, it works fine.  But, when I create a button either on the edit page or the view page of the Sales Order layout, it doesn't work.  I have the argument mapping set as:
SO_Number = Sales Order ID.

Is there something I'm missing?  I figure there must be something wrong with how the ID is being passed when using a button, but I don't know how to track it down either.

      • Sticky Posts

      • Zoho CRM Plus in 2023: Let's rewind

        Hey everyone, There's something about December that makes us want to sit back and remember all the wonderful moments, as we get ready for the New Year, 2024! (Psst! We are also turning 10—yay!) This year, CRM Plus had a lot of wonderful updates, taking
      • The CX Workshops are back in 2023!

        Hello, can you see my screen? Can you hear me? This is a phrase we've all been saying more often than "good morning" over the last couple of years. Well, now it's time to re-connect in person. We're excited to invite you all to the CX Workshops we've
      • Refer Zoho CRM Plus to your friends and earn rewards!

        Hey everyone,   We'd like to thank you from the bottom of our hearts for continuing to be our esteemed customers. Now you have the opportunity to refer Zoho CRM Plus to your friends or family members who are looking for a suitable solution to enhance
      • Social in CRM Plus now supports TikTok, Instagram Stories and Reels, and YouTube Shorts

        Hey everyone,   We are excited to inform you that Social in CRM Plus now allows you to publish on TikTok! We've also updated it to let you create Instagram Stories and Reels, as well as YouTube Shorts. Here's a brief about the updates.  Publishing on
      • Unified telephony in Zoho CRM Plus

        In any business, managing calls with the prospects or customers is an integral part of a salesperson or a support agent's daily life. They have access to information about the customers within Zoho CRM, and they also use a suitable PBX service to communicate