Load PO_Date field (Purchase Order) with current date in Deluge

Load PO_Date field (Purchase Order) with current date in Deluge

Hi, 

I'm not a full time developer, just helping to customize our CRM, in the small company I work for. There must be something wrong with me, because I can't do something so simple as complete a field with the current date in a function using Deluge. I'm getting errors like "UnParsable date" or "INVALID_DATA" or just "Error". 

I don't want to use a workflow rule, I need to modify this function that someone wrote, it creates a PO for each Supplier in the Sales Order (using a button).

Thanks in advance, I'm about to give up..


This is the part I want to add:
--------------------------------------------------------
dateVariable = ?? ;    //STEP 1
po_map.put("PO_Date", dateVariable);  // STEP 2
--------------------------------------------------------


This is the function:
---------------------------------------------------
string button.convert_so2po(Int so_id)
{
result_string = "Resultado: ";
// Obtiene la orden de venta.
so_aux = zoho.crm.getRecordById("Sales_Orders",so_id);
so_quote_link = so_aux.get("quote_link");
so_oc_cliente_link = so_aux.get("oc_cliente_link");
po_link_map = Map();
po_link_map.put("quote_link",so_quote_link);
po_link_map.put("oc_cliente_link",so_oc_cliente_link);
so_read = invokeurl
[
type :GET
connection:"zohocrmcon"
];
so = so_read.get("data").get(0);
//info "SO: " + so;
//Si la SO ya tiene PO, le pide que primero las borre y sale de la función.
/*if(!so.get("ordenes_de_compra").isEmpty())
{
return "Por favor, borre primero las OC Generadas.";
}*/
// Obtiene la lista de items a comprar
so_items = so.get("Ordered_Items");
// Crea la lista de proveedores para luego generar una PO por cada uno
proveedores = List();
for each  _item in so_items
{
_proveedor = _item.get("Proveedor");
if(proveedores.contains(_proveedor) = False)
{
proveedores.add(_proveedor);
}
}
// Completa los datos comunes a todas las PO que genera a través de la SO
//po_map.put("Nombre_de_Cuenta",so.get("Account_Name"));
//po_map.put("Nombre_de_Negocio",so.get("Deal_Name"));
//po_map.put("Nombre_de_Presupuesto",so.get("Quote_Name"));
po_map = Map();
po_map.put("Orden_de_venta",so.get("id"));
po_map.put("quote_file",so.get("quote_file"));

dateVariable = ?? ;     //STEP 1
po_map.put("PO_Date", dateVariable);    // STEP 2

so_asunto = so.get("Subject");
// Completo los datos específicos de cada PO, una por cada proveedor.
ordenes_de_compra = List();
aux_po_id = 0;
// Sufijo del número de PO
for each  _proveedor in proveedores
{
aux_po_id = aux_po_id + 1;
order_list = List();
for each  _item in so_items
{
// info "Item:" + _item;
if(_item.get("Proveedor") = _proveedor)
{
_order_line = Map();
_order_line.put("Product_Name",_item.get("Product_Name"));
_order_line.put("Description",_item.get("Description"));
_order_line.put("articulo_dsi",_item.get("articulo_dsi"));
_order_line.put("Quantity",_item.get("Quantity"));
_order_line.put("List_Price",_item.get("List_Price"));
_order_line.put("IVA",_item.get("IVA"));
_order_line.put("quote_id",_item.get("Quote"));
order_list.add(_order_line);
}
}
po_map.put("Vendor_Name",_proveedor);
po_map.put("Purchase_Items",order_list);
asunto = so_asunto + " (" + _proveedor.get("name") + ")";
po_map.put("Subject",asunto);
po_number = so.get("N_mero_AR") + "-" + aux_po_id.toString("00");
po_map.put("oc_numero",po_number);
// info _proveedor + "<->" + po_map;
dmp_list = List();
dmp_list.add(po_map);
dmp = Map();
dmp.put("data",dmp_list);
info dmp;
// Preparo la URL para invocar en la creación de Órdenes de compra
create_po = invokeurl
[
type :POST
parameters:dmp + ""
connection:"zohocrmcon"
];
// Creo la Orden de compra
result = create_po;
result_code = result.get("data").get(0).get("code");
result_string = result_string + po_number + "@" + _proveedor.get("name") + ": " + result_code + ". ";
info result;
po_id = result.get("data").get(0).get("details").get("id");
// Agrego la lista de quotes
zoho.crm.updateRecord("Purchase_Orders",po_id,po_link_map);
// info "LEO " + zoho.crm.getRecordById("Purchase_Orders", po_id);
_po_ref = Map();
_po_ref.put("name",asunto);
_po_ref.put("id",po_id);
orden_de_compra = Map();
orden_de_compra.put("ordenes_de_compra",_po_ref);
ordenes_de_compra.add(orden_de_compra);
}
// Preparo la URL para invocar
so_oc = Map();
so_oc.put("ordenes_de_compra",ordenes_de_compra);
dmp_list = List();
dmp_list.add(so_oc);
dmp = Map();
dmp.put("data",dmp_list);
info dmp;
update_so = invokeurl
[
type :PUT
parameters:dmp + ""
connection:"zohocrmcon"
];
// Actualizo el registro
info update_so;
return result_string;
}
    • Sticky Posts

    • Kaizen #197: Frequently Asked Questions on GraphQL APIs

      🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Kaizen #198: Using Client Script for Custom Validation in Blueprint

      Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

      Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
    • Kaizen #193: Creating different fields in Zoho CRM through API

      🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Client Script | Update - Introducing Commands in Client Script!

      Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands
    • Recent Topics

    • OS X Notebook quits immediately upon launch

      NoteBook for OS X (Sequoia, but also under Sonoma) always quits immediately upon launch (so I cannot use the "Attach user log" option). I've restarted my MacBook but the problem persists. If it helps, attached is a diagnostic report from Library>Log
    • Can External users upload files or images to WorkDrive?

      I want to know if it is possible for someone externally through a link and PW be able to upload files and images onto WorkDrive?
    • Multi-line fields character limits

      Is there a way to set the character limit higher on multi-line fields so that we are not losing information pasted into the field? When the text is entered or pasted, there is no error to say that the text is too large. After saving and going back to view most of the text is gone.   Also, when viewing the resume, the text is not wrapped in the multi line fields and can t be read without scrolling across the page.
    • Taz bot not working — What should I do to resolve this issue?

      I am experiencing issues with the Taz bot in Zoho Cliq—not receiving responses or it does not seem to work as expected. Could you please explain why the Taz bot might not be functioning and what steps I should take to resolve this issue? Thank you!
    • OneNote Migration

      I am trying to migrate two notebooks from OneNote. For five days now I have had no notification that migration has completed and the migration page show 50% complete - one notebook completed one not finished. It just stays like this. I am unable to cancel
    • Set various time slot reminders for task and event

      Hi I would like known if there is possibility to set various time reminders for a task or event like we have the possibility to do in google calendar or google task. For example I'am creating an event or task and I want to be alerted before 30min and
    • Zoho Calendar not functioning---cannot edit, add attendees, etc.

      Hello, My calendar is acting strange. I'm using Chrome as my browser and pop ups are not blocked (the calendar worked fine yesterday). When creating an event, I'm not able to "edit" the event and add attendees, etc. The link is non-responsive. I cannot
    • Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked

      Hi, I sent few emails and got this: Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked And now I have few days since I cant send any email. Is there something wrong I did? Also can someone fix this please
    • Spilt Axis for stacked column and line graph

      Each month around this time I prepare a business review deck. One of the biggest annoyances I have with Zoho, also happens to be something that most other platforms have provided for a long time now, and that is being able to create a chart with stacked
    • Pin a note on top

      Dear Zoho Notebook Team, Please highly consider adding ability to pin a note on top and arrange pinned notes. I have a lot of notes that I want to pin important ones on top and this feature is missing badly. Thank you.
    • Windows 11 app ver 2.2.8

      I have been trialing Zoho Notes syncing between my PC and iphone. No problems with iphone but the Windows 64 bit app ver 2.2.8 was very buggy and would lock up completely, needing a Control Alt Delete etc to close it down. It seemed to be connected to
    • Deluge Script: Onboarding → Access Form

      Hello everyone, Edit: Sorry, I think I put this topic in the wrong section. I’ve recently run into an issue that’s been giving me a bit of a headache for the past few weeks. Context: This is my first time using Deluge to create a script, but it’s not
    • Windows Device Authentication

      We have recently started using ManageEngine, and my boss saw a device management feature in the Zoho One directory. We thought it would either help give us more intergration into Zoho one through bringing ManageEngine services through Zoho one. Or, it
    • How can I change spell check language?

      I cannot find the way to change spell check language. My "display language" is English, and I want to have the same one for Spell Check, but it is Russian!!! How can I change it? In one of your explanations you mentioned that I have to choose it from
    • Mail is so slow - doesn't even work!

      Mail has been getting slower and slower - and today it's not even pulling up emails in either Inbox or Unread. This is beyond frustrating since email is a big part of business. Sent a request through the useless help portal - no response. Called the useless
    • User marked as SPAMMER. Mail Fetch has also been disabled for any active POP accounts.

      I am the administrator for joelles.com One of our accounts has been blocked saying this: User marked as SPAMMER. Mail Fetch has also been disabled for any active POP accounts. I cannot change the disabled account in the control panel as it says that it
    • My domain did not activate

      Hi, my domain (apsaindustrial.com.ar) did not activate, and the phone verification message never arrived. Please would you solve this problem? Thanks.
    • ME SALE ESTE ERROR: No fue posible enviar el mensaje;Motivo:554 5.1.8 Email Outgoing Blocked

      Ayuda!! Me sale este error al intentar enviar mensajes desde mi correo electronico de Zoho! Tampoco recibo correos pues cuando me envia rebotan. Ayuda, Me urge enviar unos correo importantes!! Quedo atenta MAGDA HERNANDEZ +5731120888408
    • Is there a way to sync Tags between CRM and Campaigns/Marketing Hub?

      I wonder if there is a way to synch the tags between CRM and Marketing-Hub / Campaigns?
    • how to see if a specific contact opened an email in zoho campaign?

      how to see if a specific contact opened an email in zoho campaign?
    • Revenue Management: #8 Revenue Recognition in Educational & Training Institutions

      Educational Institutions and training centres typically collect course fees at the time of enrolment, sometimes for a one-day workshop and sometimes for a year-long certification course. You might also charge separately for course materials or evaluation.
    • How to Customize Task Creation to Send a Custom Alert Using JavaScript in Zoho CRM?

      Hello Zoho CRM Community, I’m looking to customize Zoho CRM to send a custom alert whenever a task is created. I understand that Zoho CRM supports client scripts using JavaScript, and I would like to leverage this feature to implement the alert functionality.
    • how to use validation rules in subform

      Is it possible to use validation rules for subforms? I tried the following code: entityMap = crmAPIRequest.toMap().get("record"); sum = 0; direct_billing = entityMap.get("direct_billing_details"); response = Map(); for each i in direct_billing { if(i.get("type")
    • Using files from Zoho CRM in Gemini/ChatGPT/Claude

      Hi all, I’ve got subscriptions to Gemini and a few other AI tools which I use for tasks like data enrichment, email composition, etc. In our workflow, we often receive various documents from clients — such as process workflows, BRDs/requirement documents
    • Enhancements to the formula field in Zoho CRM: Auto-refresh formulas with the "Now" function, stop formula executions based on criteria, and include formulas within formulas

      Dear Customers, We hope you're well! By their nature, modern businesses rely every day on computations, whether it's to calculate the price of a product, assess ROI, evaluate the lifetime value of a customer, or even determine the age of a record. With
    • Maximum file limit in zoho people LMS

      Dear Team, I am having approximately 4.9 GB of material, including PPTs and videos for uploading in zoho people LMS course. May I know what is the maximum limit limit for the course files Thanking you, With regards, Logeswar V Executive _ Operations
    • Dynamically prefill ticket fields

      Hello, I am using Zoho Desk to collect tickets of our clients about orders they placed on our website. I would like to be able to prefill two tickets fields dynamically, in this case a readonly field for the order id, and a hidden field for the seller
    • Optimize your Knowledge Base for better visibility by allowing search engine crawling and indexing

      All you need to know about no-follow and no-index in KB. What are article crawlability and indexability? Crawlability and indexability are vital for making an article visible and accessible to search engines. When a search engine crawls an article, it
    • Has anyone created a public ASAP Guide that I can check out?

      I am thinking of adding an ASAP guide to my web application, but I have noticed that the ASAP widget itself can be really slow to load sometimes. Has anyone created a public ASAP Guide that I can check to see how performant it is? I don't want to spend
    • Zoho Desk Partners with Microsoft's M365 Copilot for seamless customer service experiences

      Hello Zoho Desk users, We are happy to announce that Zoho Desk has partnered with Microsoft's M365 to empower customer service teams with enhanced capabilities and seamless experiences for agents. Microsoft announced their partnership during their keynote
    • What’s New in Zoho Analytics – September 2025

      Hello Users!! In this month’s update, we’re raising the bar across multiple touchpoints, from how you bring in data, plan and track projects to how you design and brand your dashboards. We’ve added the all-new Gantt chart for project visualization, expanded
    • Zoho MCP has no tools for Creator or 3rd Party Apps?

      I don't see a Zoho MCP community forum so putting this here. Two big problems I see: 1) Although Zoho advertises "over 950 3rd party apps" as available through their MCP, when I go to "Add Tools" there are ZERO 3rd party apps available to choose from.
    • Zoho Forms - Zoho Drive connection - Shared Drives not supported

      Hello i am stuck with Google Drive Connection There is no supported shared drives Connection is not support shared drives boolean Query Parameters - supportsAllDrives=true&supportsTeamDrives=true to activate fetch files from the shared drives. Ahat need
    • Can't create package until Bill created?

      I can't understand why we cannot create a package until a Bill is created? We are having to created draft Bills to create a package when the item is received, but we may not have received a Bill from the supplier. Also, Bill # is required, but we normally
    • Whats the Time out Limit for API Calls from Deluge?

      Hi Creator Devs, We are making API calls to third party server via Deluge. Getting this error message: Error at line : 24, The task has been terminated since the API call is taking too long to respond. Please try again after sometime. Whats the default
    • How to get the authorization code for domain transfer from Zoho?

      I have transferred my domain from zoho to godaddy, and that needs a authorization code. I haven't got any mail containing that. How to get the authorization code from domain transfer? Thanks, Arun
    • Community Digest Agosto 2025 - Todas las novedades en Español Zoho Community

      ¡Hola, Zoho Community! Agosto llega a su fin y septiembre nos trae aire fresco a la comunidad: más inteligencia con IA, actualizaciones que elevan la productividad y la recta final hacia Zoholics España 2025. Aquí tienes lo más destacado del mes para
    • I have error AS101 when I try to add paypal@mydomain.com to Zoho

      Please help me with this. I tried to call the help line 4 times but don't get any response.
    • Tip #3: How to change your booking page language

      Displaying your booking page in your target audience's language can greatly increase customer satisfaction. By speaking their language, you will help customers feel more comfortable scheduling with you and create a stronger connection with them. Let's
    • How can I optimize a Zoho Site page for SEO when embedding external menu or restaurant links?

      Hi everyone, I’m experimenting with building small content hubs on Zoho Sites and want to make sure I’m doing it in an SEO-friendly way. For example, I tried creating a page that highlights restaurant menu items and linked out to a resource like this:
    • Next Page