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

    • Can I add Conditional merge tags on my Templates?

      Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
    • Zoho CRM button to download images from image upload field

      Hello, I am trying to create a button in Zoho CRM that I can place in my record details view for each record and use it to download all images in the image upload fields. I tried deluge, client scripts and even with a widget, but feel lost, could not
    • email moderation issue when email is sent in the name of a mail group

      Symptom: an email that is sent by a mail group moderator in the name of a moderated mail group is held back for approval. Reproduction: Create a moderated mail group with members and moderators. Allow that mails can be sent in the name of the group (extended settings). Send an email to the group as a group moderator, but in the name of the group. This mail is held back for moderation which is unexpected. Expected: A mail sent by group moderator to a moderated group are not held back for moderation
    • blank page after login

      blank page after logging into my email account Thanks you
    • Introducing the revamped What's New page

      Hello everyone! We're happy to announce that Zoho Campaigns' What's New page has undergone a complete revamp. We've bid the old page adieu after a long time and have introduced a new, sleeker-looking page. Without further ado, let's dive into the main
    • Always display images from this sender – Is this feature available?

      In Zoho mail, I had my "Load external images" setting set to "Ask me", and that's fine. That's the setting I prefer. What's not fine though is I always need to tick "Display now" for each email I get, regardless if I've done that multiple times from several
    • Function #9: Copy attachments of Sales Order to Purchase Order on conversion

      This week, we have written a custom function that automatically copies the attachments uploaded for a sales order to the corresponding purchase order after you convert it. Here's how to configure it in your Zoho Books organization. Custom Function: Hit
    • Free webinar: Security that works: Building resilience for the AI-powered workforce

      Hello there, Did you know that more than 51% of organizations worldwide have experienced one or more security breaches, each costing over $1 million in losses or incident response? In today’s threat landscape, simply playing defense is no longer enough.
    • "Subject" or "Narration"in Customer Statement

      Dear Sir, While creating invoice, we are giving in "Subject" the purpose of invoice. For Example - "GST for the month of Aug 23", IT return FY 22-23", "Consultancy", Internal Audit for May 23". But this subject is not coming in Customer Statement. Only
    • Apply Vendor Credit Automatically

      Hello!!! Is there a way where in we can apply vendor credits automatically on the FIRST OUTSTANDING BILL of the vendor?? We have lots of VENDOR CREDITS ISSUES mostly!!! Applying it manually is a pain for us. Would be great if we have a way to apply the
    • Zoho Notebook Sync problem

      I'm facing a problem with syncing of notebook on android app. It's not syncing. Sometimes it syncs after a day or two.  I created some notes on web notebook but it's not syncing on mobile app. Please help!!!!
    • Cliq iOS can't see shared screen

      Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
    • Retainer Invoice.

      Why ZOHO not have facilities to deduct partially advance payment from an invoice.
    • Apply Vendor Credits Automatically

      We are bulk importing Vendor credits in Zoho Books!!! Is there a way to apply vendor credits automatically to the first UNPAID bill of the Vendor?
    • Cant Save Gauge on Creator Page

      How to Save Gauge on Creator Page see movie https://vimeo.com/1116410860?share=copy#t=0
    • Apply Advance option not shown in report

      We are facing an issue in Zoho Expenses. While approving an Expense Report, the "Apply Advance" option is not appearing under the three dots (More Options). Details: Module: Expense Reports Issue: "Apply Advance" option not visible Status of Report: Awaiting
    • Introducing Assemblies and Kits in Zoho Inventory

      Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
    • Auto Capitalize First Letter of Words

      Hi I am completely new to ZOHO and am trying to build a database. How can i make it when a address is entered into a form field like this: main st it automatically changes is to show: Main St Thank You
    • Follow-up emails via Workflow Automation not staying in the same thread

      Dear Zoho Support Team, I am currently using Workflow Automation in Zoho Campaigns to send follow-up emails. In my test case, I noticed the following behavior: All emails in the automation have the same subject line. If the follow-up email is sent within
    • Client Script refuses to set an initial value in Subform field

      I tried a very simple, 1 line client script to set a default value in a custom subform field when the "Add Row" button is clicked and the user is entering data. It does not work - can someone tell me why? ZDK documentation suggests this should be doable.
    • Formatting of Balance Sheet and Profit & Loss Reports

      The default format of the Balance Sheet and P&L Reports are based on the Account Types and then the individual accounts within the Chart of Accounts. These are then ordered alphabetically under these sub-headings and one is unable to re-order these or
    • Emails Are Not Being Delivered to My Inbox

      Hello Zoho Support Team, I am experiencing an issue with my Zoho Mail account. The most important problem is that emails are not being delivered to my inbox. Details: My Zoho Mail address: info@coreforcelife.com What happens: I am not receiving any incoming
    • Help Center IFrame Issue

      I have had a working Help Center on my website using an iframe for a while. But now for some reason the sign in page gets a refused to connect error. Can someone please help. If I go to the url manually it works correclty
    • Staff rules

      Hi! Do you people know what are the default staff rules when a new booking is created? We have two staff members in my team (me as the admin, and my employee). As we share the same services, I'm wondering how Zoho will pick the staff for new apointments.
    • Comment Templates

      Is it possible to add a template option for comments? We have some agents in the process who's responses require a pre-formatted layout. It would be incredibly handy to have a template for them where they can insert the template and then add their responses
    • [ZohoDesk] Improve Status View with a new editeble kanban view

      A kanban view with more information about the ticket and the contact who created the ticket would be valueble. I would like to edit the fields with the ones i like to see at one glance. Like in CRM where you can edit the canvas view, i would like to edit
    • Adding Markdown text using Zoho Desk API into the Knowledge Base

      Hi Zoho Community members, We currently maintain the documentation of out company in its website. This documentation is written in markdown text format and we would like to add it in Zoho Knowledge Base. Do you know if there is REST API functionality
    • An Exclusive Session for Zoho Desk Users: AI in Zoho Desk

      A Zoho Community Learning Initiative Hello everyone! This is an announcement for Zoho Desk users and anyone exploring Zoho Desk. With every nook and corner buzzing, "AI's here, AI's there," it's the right time for us to take a closer look at how the AI
    • Shared values: From classroom lessons to teaching moments in customer service

      While the world observes Teachers’ Day on October 5, in India, we celebrate a month earlier, on September 5, to mark the birth anniversary of Dr. Sarvepalli Radhakrishnan, a great teacher, renowned scholar, educationist, and advocate for empowerment.
    • Export to excel stored amounts as text instead of numbers or accounting

      Good Afternoon, We have a quarterly billing report that we generate from our Requests. It exports to excel. However if we need to add a formula (something as simple as a sum of the column), it doesn't read the dollar amounts because the export stores
    • Create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM

      How to create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM? I was able to do a view in CRM based on customer that registered to an event, but I don't seems to be able to include the filter
    • Zoho Desk blank page

      1. Click Access zoho desk on https://www.zoho.com/desk/ 2. It redirects to https://desk.zoho.com/agent?action=CreatePortal and the page is blank. Edge browser Version 131.0.2903.112 (Official build) (arm64) on MacOS
    • I hate the new user UI with the bar on the left

      How can I reverse this?
    • Constant color of a legend value

      It would be nice if we can set a constant color/pattern to a value when creating a chart. We would often use the same value in different graph options and I always have to copy the color that we've set to a certain value from a previous graph to make
    • Question regarding import of previous deals...

      Good afternoon, I'm working on importing some older deal records from an external sheet into the CRM; however, when I manually click "Add New Deal" and enter the pertinent information, the deal isn't appearing when I look at the "Deals" bar on the account's
    • Client Script also planned for Zoho Desk?

      Hello there, I modified something in Zoho CRM the other day and was amazed at the possibilities offered by the "Client Script" feature in conjunction with the ZDK. You can lock any fields on the screen, edit them, you can react to various events (field
    • One person/cell phone to manage multiple accounts

      Hi. I have a personal Free account to keep my own domain/emails. Now I need to create a Business account to my company's own domain, but I have only one mobile phone number I use to everything. How do I do to manage this? Can I manage a Free domain and
    • Tracking KPIs, Goals etc in People

      How are Zoho People users tracking employee targets in People? For example, my marketing assistant has a target of "Collect 10 new customer testimonials every month". I want to record attainment for this target on a monthly basis, then add it to their
    • Zoho Desk: Ticket Owner Agents vs Teams

      Hi Zoho, We would like to explore the possibility of hiding the ‘Agents’ section within the Ticket Owner dropdown, so that we can fully utilise the ‘Teams’ dropdown when assigning tickets. This request comes from the fact that only certain agents and
    • Can not Use Attachment Button on Android Widget

      this always pops up when I touch the attach button on android widget. going to settings, there is no storage permission to be enabled. if I open the app, and access the attach feature there, I can access my storage and upload normally.
    • Next Page