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 any way to recall an email sent using Zoho CRM?

          If an email is sent using Zoho Mail, there is a recall option/functionality that is available to the sender. Is there any way to recall an email if it was sent using Zoho CRM? I can't seem to find that option. Any help would be appreciated.
        • Quick Create needs Client Script support

          As per the title. We need client scripts to apply at a Quick Create level. We enforce logic on the form to ensure data quality, automate field values, etc. However, all this is lost when a user attempts a "Quick Create". It is disappointing because, from
        • is it possible to add more than one Whatsapp Phone Number to be integrated to Zoho CRM?

          so I have successfully added one Whatsapp number like this from this User Interface it seems I can't add a new Whatsapp Number. I need to add a new Whatsapp Number so I can control the lead assignment if a chat sent to Whatsapp Phone Number 1 then assign
        • Problem with reports due to "Connected" items change - Yes this IS a problem

          Now that the change has been made to use "connected" items I can no longer run the reporting I need in CRM. I should be able to start with Deals as the parent, connect down to the Account (Account_Name) on the deal as the child, then to any child items
        • Zoho sheet desktop version

          Hi Zoho team Where can I access desktop version of zoho sheets? It is important as web version is slow and requires one to be online all the time to do even basic work. If it is available, please guide me to the same.
        • Introducing notifications in the vendor portal

          Imagine this: You're a recruiter working with multiple vendors on a high-volume hiring project. You’ve just updated a job description after a last-minute change from the hiring manager. One of your vendors, however, is still working off the older version
        • CRM limit reached: only 2 subforms can be created

          we recently stumbled upon a limit of 2 subforms per module. while we found a workaround on this occasion, only 2 subforms can be quite limiting in an enterprise setting. @Ishwarya SG I've read about imminent increase of other components (e.
        • LESS_THAN_MIN_OCCURANCE - code 2945

          Hi I'm trying to post a customer record to creator API and getting this error message. So cryptic. Can someone please help? Thanks Varun
        • How to update "Lead Status" to more than 100 records

          Hello Zoho CRM, How do I update "Lead Status" to more than 100 records at once? To give you a background, these leads were uploaded or Imported at once but the lead status record was incorrectly chosen. So since there was a way to quickly add records in the system no matter how many they are, we are also wondering if there is a quicker way to update these records to the correct "Lead Status". I hope our concern makes sense and that there will be a fix for it. All the best, Jonathan
        • Analytics for notes created

          Is there a way I can see how many notes were created per day? Via reporting or analytics?
        • Add Custom Reports To Dashboard or Home Tab

          Hi there, I think it would be great to be able to add our custom reports to the Home Tab or Dashboards. Thanks! Chad
        • Cannot update Recurring_Activity on Tasks – RRULE not accepted

          Hello, I am trying to update Tasks in Zoho CRM to make them recurring yearly, but I cannot find the correct recurrence pattern or way to update the Recurring_Activity field via API or Deluge. I have tried: Sending a string like "RRULE:FREQ=YEARLY;INTERVAL=1"
        • Add image to report...

          Greetings, I send a weekly color coded report via Creator email. I would like to add the legend somewhere in the report. Header, footer where ever. I have the legend saved on Google Drive and can access it via shared link. Sure someone has wanted to add
        • More controls for User Fields in CRM

          Dear All, We are here with a minor but crucial enhancement to the user fields—now set accessibility permissions to the records for user field. User field allows you to extend co-ownership of records to your peers. You can collaborate with them for certain
        • Calls to accounts rather than leads or contacts?

          So..... We have a dilemma and I'm hoping someone has encountered this before and figured out a fix. We have just migrated to Zoho. It's great.....expect for how "Calls" are handled.... We are B2B. We do not use the leads module. A "Lead/Prospect" for
        • Image Upload Field | Zoho Canvas

          I'm working on making a custom view for one of our team's modules. It's an image upload field (Placement Photo) that would allow our sales reps to upload a picture of the house their working on. However, I don't see that field as a opinion when building
        • Power of Automation :: Automated 'Delayed & Closed' Status Update Based on Due Date

          Hello Everyone, A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate
        • Lead Blueprint transition in custom list view

          Hi, Is It possible to insert the Blueprint transition label in a custom Canvas list view? I am using Lead module. I see the status, but it would be great if our users could execute the Blueprint right from the list view without having to enter the detailed
        • Range names in Zoho Sheet are BROKEN!

          Hi - you've pushed an update that has broken range names. A previously working spreadsheet now returns errors because the range names are not updating the values correctly. I've shared a video with the support desk to illustrate the problem. This spreadsheet
        • Has anyone integrated SMS well for Zoho Desk?

          Our company does property management and needs to be able to handle inbound sms messages which create a ticket for Zoho Desk. We then need to be able to reply back from Zoho desk which sends the user an sms message. This seems like a fairly common thing
        • populate email address and name in zoho desk?

          Is it possible to populate the email address and name in the zoho desk widget? We only use it in the context of an authenticated user, so we already know the user's name and email. Thanks,
        • Are there default/pre-built dashboards in Zoho Desk?

          Hi, I am looking for some pre-built dashboard templates in Zoho Desk, similar to what we can find in CRM/Projects, etc Thank you
        • Enable Locations for Expense

          Hi, please enable Locations (ex Branches) for Zoho Expense so that there is consistency between this app and Zoho Books. Thanks in advance.
        • Adding branded signature to tickets reply

          Hi, i am unable to figure out how to add signatures with logo to tickets reply. please advice .
        • Zoho Marketing Automation 2.0 - Landing Page function not working

          Dear Zoho Team, I am working on implementing Zoho Marketing Automation 2.0, and am now looking into the section "Lead Generation". If I open the "Landing Pages" section, I immediately get an Error code: Error: internal error occurred. Can you help me
        • Zoho Mail Android app update: Manage folders

          Hello everyone! In the latest version(v2.9) of the Zoho Mail Android app update, we have brought in support for an option to manage folders. You can now create, edit, and delete folders from within the mobile app. You can also manage folders for the POP
        • How to share ticket numbers across different ticket types

          I'm running an event and have three different ticket types. Add on Event + Main Event - Early bird Main Event only - Early bird Add on Event only - Early bird And Standard class - shown but not available until early bird finishes Add on Event + Main Event
        • How to keep track of bags, cans, drums of inventory?

          We buy and sell products that are packaged in bags 🛍️, cans🥫, drums🛢️, etc. with batch numbers. When we get a shipment of one of the products, how do we track we received (say) 10 cans each of 5L of a product and maybe we received 10 cans of another
        • Adding Social Media Buttons to Basic Campaigns

          Hi, I'm quote new to using Zoho Campaigns and I can't work out how to add Social Media Buttons into my basic campaign? In MailChimp there's a button that brings the icons into your campaign for you. I've tried adding the social media icons as 'buttons' in Zoho but it's not looking great. Can anyone help? Thanks!
        • Hide Inactive Social Sign-In Providers from Login Screen

          Hello Zoho Team, We hope you are doing well. Currently, Zoho One allows admins to configure security policies and enable or disable Social Sign-In options for third-party providers such as Apple, Google, Microsoft, LinkedIn, Yahoo, Twitter, Facebook,
        • [Free Webinar] AI Agents in Zoho Creator - Creator Tech Connect

          Hello Everyone! We welcome you all to the upcoming free webinar on the Creator Tech Connect Series. The Creator Tech Connect series is a free monthly webinar that runs for around 45 minutes. It comprises technical sessions in which we delve deep into
        • Download All Attached Files

          It would be extremely useful to have "download-all" functionality for downloading files attached to a task, subtask, comment, forum post or hosted in the "Documents" section etc. We've instructed our users to zip multiple files prior to uploading, but of course they forget all the time. Having to download lots of files one-at-a-time off a comment or task wastes a lot of time.
        • Ship via Carrier Not Working Since Commerce Update

          Since the recent update to the Commerce platform, I can no longer use the ship via carrier function. It will take me to the address screen and let me verify them but when I go to save and move tot he next screen it will not do anything. This is happening
        • automations: Can I execute a step on a specific date?

          I have created a form in Zoho forms, and created a contacts list. I have also begun setting up an automation with the intention of sending the form to the contact list on a specific date every month (via email) for the entire year (essentially sending
        • Zoho Expense - The ability to add detail to a Trip during booking

          As an admin, I would like the ability to add more detail to the approved Trips. At present a requestor can add flights, accommodation details and suggest their preferences. It would be great if the exact details of the trip could be added either by the
        • Adding Folders in Android App

          Is it possible to create a new email folder within the Zoho Mail Android app?  Or can this only be done from the desktop version of Zoho Mail? Cheers!
        • Schedule Exports for Regular Project Updates

          Tracking project data often means exporting data at regular intervals. Instead of manually exporting data every time, users can schedule exports for Phases, Tasks, and Tasks in Zoho Projects. These exports can be set to run once, daily, weekly, or monthly
        • Question about custom fields using Pivot Tables.

          I have created a pivot table showing annual revenue of a client and how much payment that client is paying my company. Is there a way using pivot table to add an additional field that subtracts those to fields / shows me a percentage of that difference?
        • Request for Light/Dark Mode

          Would love the ability to switch between Light and Dark mode similar to Zoho CRM. https://help.zoho.com/portal/en/community/topic/introducing-dark-mode-light-mode-a-new-look-for-your-crm
        • Signature field is showing black

          Hello, When customer signed the service form, it is showing as below picture Phone model: iPhone 16 Pro We tried delete and install application, but it not solved. This has on phone of a few person. There is any advice to solve this?
        • Next Page