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

    • Is there the possibility to book less than 250 customer portal users?

      If you use the Creator, which is included in Zoho ONe, you can create a customer portal and give access to a maximum of 3 external people / customers, right? On the Creator website I saw that you can add 250 users for 100€/month. However, we don't need
    • Display Parts custom fields in the Work Order

      Hello, I see that is it possible to add custom fields in the Parts module. Would it be possible to also add those custom fields in the Work Order Module under Parts? This would be very useful for customer who want to showcase more information about parts.
    • Unable to edit Saved Estimates

      We are facing issue with editing the price or discount for a saved estimate for nearly 1 week.
    • Translation Blueprint & Picklists with Custom Values

      Hello everyone, I downloaded the translation file and I'm not finding the blueprint transitions. Does this means that the transitions cannot be translated? Also, the picklist values to be translated in the document are not the same that are actually used the in module. For exemple, for my lead module, the picklist values for Lead Status are : Not-contacted, contacted, junk and lost lead. In the translation document (English to French), this is what I see: PicklistValues.Leads.Lead_Status.Contact
    • How to create a custom sales signal?

      I want to create a custom sales signal for a custom module. is it possible to create one? If anyone know please let me know
    • Multi-line address lines

      How can I enter and migrate the following 123 state street Suite 2 Into a contact address. For Salesforce imports, a CR between the information works. The ZOHO migration tool just ignores it. Plus, I can't seem to even enter it on the standard entry screen.
    • Only show products in offers based on lead source

      We work with several lead sources, each with their own products and different pricing. For example, one product might have two or three different prices. Sometimes, when creating a quote, the wrong product is accidentally selected. Is there a way to only
    • Narrative 7 - The importance of data sharing

      Behind the scenes of a successful ticketing system - BTS Series Narrative 7 - The importance of data sharing Definition Data sharing requires a commitment to preserving the integrity and dependability of shared data throughout its entire lifecycle. This
    • TrueSync regularly filling up my local disk

      Seems that WorkDrive's TrueSync randomly starts filling up my local hard drive space. None of the folders have been set as "Make Offline" but still it seems to randomly start making file offline. The settings of the app is so minimal and is of no real
    • Check out in Meetings

      Why there is no check out in Meetings of Zoho CRM, very difficult to track
    • Issue with Zoho Projet

      Zoho Project on all the cellphones of my customer is crashing. He has mixed brands (Samsung and Pixel). Everything is fine on website and mobile website. Could not reproduce the issue in workshop using Samsung/Pixel/iPhone Uninstallation of Zoho Project
    • SecurePass email English language issue -- please hire someone to correct the English language issues sprinkled throughout your interface

      I wrote previously about some incorrect English in your SecurePass offering. After about six months it was corrected. I have never revoked permission before today and just discovered another language mistake that was not corrected. When you revoke a SecurePass
    • Published Components

      @zoho team, Checking if we can add a password for the public links as we have non-licensed users
    • Zoho Creator customer portal users

      Hi, I'm in a Zoho One subscription with our company. I'm running a project now that involves creating a Zoho Creater application and using the Zoho Creator Customer Portal.  At most we need 25 customer portal users. In our Zoho One plan we only get 3
    • Please Enable Snippets for Agents Adding Comments

      Snippets and templates are currently enabled for agents when they use the reply functionality. There is currently no way to add a template or snippets when an agent comments. This is really weird. Our agents don't use the reply functionality, only the
    • Tip of the Week - Extracting Data from JSON Columns

      Let's say you are importing a CSV or Excel file into Zoho Analytics. What if the file contains a few columns in JSON format? This is where Zoho DataPrep, embedded right within Zoho Analytics, comes in handy. This week's tip explains how to extract data
    • Deluge UI Updates

      Are there any updates planned for the Deluge UI in Zoho Desk? It feels quite dated and lack-lustre after you've spent some time in the CRM Deluge UI.
    • Zia Agents - Follow Ups

      It would be nice to have Zia Agents do follow ups. A lot of times agents are trying to schedule things with users and they say "can we set your printer up tomorrow?" and the user never says anything. A way to have a personalized reminder to the user automatically
    • Hide Agents name in Ticket Responses in "My Area"

      We were able to hide the agents name in the emails, however, the customer is able to see which agent has responded to a ticket in the thread of emails by going into their Help Center thread. Is there any way we can hide that information?
    • Option to Automatically Update Extensions

      Hello Zoho Desk Team, We recently received an email notifying us about an extension update that must be done manually. We’d like to request a feature that allows extensions to be updated automatically without requiring manual intervention. This would
    • Embed Report with Auto Height

      Hello Developers, When we embed report within Page, we are getting one awesome feature to adjust the report height. "Auto" and "Custom' height. This "Auto" option works well when we have no records. But I want to embed report based on some conditions
    • Zoho Payroll: Product Updates - August 2025

      This month’s updates to Zoho Payroll bring enhanced efficiency and smarter features, simplifying payroll management for users in India, UAE, KSA, and US. Read on to explore how these updates can streamline your workflow. Filter Pay Runs by Type (India,
    • Numerical Rating for Interviewer Assessments

      Introducing Numerical Rating, a powerful new addition to interviewer assessments that brings precision and flexibility to candidate evaluations. ✅ What is Numerical Rating? Numerical Rating lets interviewers assign a score for each question in the assessment,
    • Choosing a portal option and the "Unified customer portal"?

      I am trialling Zoho to replace various existing systems, one of which is a customer portal. Our portal allows clients to add and edit bookings, complete forms, manage their subscriptions and edit some CRM info. I am trying to understand how I might best
    • User Tips: Adding Multiple Products (Package) to a Quote v2.0 (with Client Script)

      This solution is an improvement on the original idea which used deluge. My solution was posted in the comments are: https://help.zoho.com/portal/en/community/topic/adding-multiple-products-package-to-a-quote The updated version uses client script instead
    • Are downloadable product available in Zoho Commerce

      Hi all. We're considering switching to Zoho Commerce for our shop, but we sell software and remote services. Is there a features for downloadable products? I can't find any information about this. Thank you very much Alice
    • Need Faster Help? Try Live Chat Support

      Hello there, We understand that sometimes, whether you’re facing an issue, exploring a feature, or need quick clarification, sending an email and waiting for a response just doesn’t cut it. You need answers, and you need them now. That’s exactly why we
    • Custom image for each contact using merge tag

      Hi, I'm wondering if it's possible to set up an email campaign to display a different image for each contact using a custom field for the image url. I tried inserting custom html: <img src='$[UD:APP_IMAGE_URL||]$'/> but the editor seemed to reject this and did not actually add anything to the email template. Has anyone got any ideas? cheers, Jeremy
    • Comment Reactions like a Thumbs Up

      Can we please have the ability to emoji react on comments or at the very least, thumbs a comment up? Literally every other project management system out there can support this and it is very much needed to just acknowledge a comment instead of completely
    • Zoho Mail Search Engine Sucks

      Hello There! I really like all the features of Zoho Mail and I believe is way better than Gmail except for the Search Function. I believe Zoho Mail has a very poor search function, if you misspelled a word in the search box, Zoho Mail won't display any
    • Allow Subtasks and Task Lists to have their own Layout

      I'd like to have the ability for subtasks and task lists to have their own layout.  A subtask for us doesn't require all the fields that a parent task has.  The subtask seems cluttered with all the extra fields. Within a project Task List had different purposes.  I'd like the task layout to be different for some task lists.
    • How to update Customers in Zoho Books through Zoho Flow?

      Updating customers in Zoho Flow using a "update customer" action is deleting contact persons in Zoho Books.
    • Conect chat of salesiq with zoho cliq

      Is there any way to answer from zoho cliq  the chat of salesiq initiated by customers?
    • How to transfer credit between customers?

      Hi All, We have a slightly odd situation. It happens that we have two separate customers that are related to each other personally. One customer has an amount of credit, and would like to use that credit to pay the *other* customers invoice. How would
    • Zoho Books Reports: Basic report with total items sold and Cost of goods sold

      How can books show a report with Item Name || Qty Sold || Total Revenue || Total Cost of Goods Sold || Margin I need to factor in also invoices that have been credited where customers returned good. This seems like such a basic report, I'm sure I'm missing
    • The amount entered is more than the balance due for the selected bills."

      Hi Team i am trying to record payments for vendors using API and getting this error in response as { "code": 28011, "message": "The amount entered is more than the balance due for the selected bills." } JSON is prepared according to Documentation and
    • VBA handling named ranges

      In VBA I'm able to work with a single cell named range. E.g. Set Jr = Range ("Year").Value. Also other options are working fine, like Range("Year").Address shows $L$3. However a named range refering to multiple cells is not working for me. Eg. tbl_Test
    • Kaizen #176 - Optimizing the Use of Record ID Variables in Zoho CRM Queries

      Hello everyone! Welcome to another week of Kaizen! Since the release of Queries, we have covered Handling Query Variables in Zoho CRM, Serialization and Schema Management, and Leveraging the 'crmAPIResponse' object in Queries in previous posts. Today,
    • Unbilled Items Report?

      Hello! Is there any way to display a list of items that remain unbilled, without creating an invoice for each customer to see if the unbilled items box is displayed? ;-) Ben
    • Consolidation of Multi currency

      Would like to discuss on the possibility of consolidating the ZOHO companies
    • Next Page