Converting Sales Order to Purchase Order

Converting Sales Order to Purchase Order

Hi All, 

Firstly, this code works to convert a sales order(SO) to a purchase order (PO) via a button, however I am running into an issue when I convert the SO where the values from the line items are not pulled across from the SO to the PO. 

The ones in question are the Discount/Adjustment, Wholesale Price and Maker Price.

I think the code below first references the Product module record first hence the API names, Euro Price for Maker Price and Wholesale_Price_1 for the Wholesale Price.


Below is the code I am using, it may also be something simple where I shouldn't be using the API names but the field names and vice versa - if anyone could assist with this would be grateful. 

string button.PO_from_SO(String soId)
{
respMap = zoho.crm.getRecordById("Sales_Orders",soId.toLong());
productDet = ifnull(respMap.get("Product_Details"),list());
pdlist = List();
for each  eachProd in productDet
{
productvalue = eachProd.get("product");
proid = productvalue.get("id");
proname = productvalue.get("name");
mp = Map();
mp.put("product",{"name":proname,"id":proid});
mp.put("quantity",ifnull(eachProd.get("quantity"),"0").toLong());
mp.put("list_price",ifnull(eachProd.get("list_price"),"0.0").toDecimal());
mp.put("discount",ifnull(eachProd.get("discount"),"0.0").toDecimal());
mp.put("wholesale_price",ifnull(eachProd.get("wholesale_price_1"),"0.0").toDecimal());
mp.put("maker_price",ifnull(eachProd.get("euro_Price"),"0.0").toDecimal());
mp.put("total",ifnull(eachProd.get("total"),"0.0").toDecimal());
mp.put("net_total",ifnull(eachProd.get("net_total"),"0.0").toDecimal());
pdlist.add(mp);
}
paramap = Map();
paramap.put("Product_Details",pdlist);
paramap.put("Subject",ifnull(respMap.get("Subject"),""));
contact = respMap.get("Contact_Name");
if(contact != null)
{
paramap.put("Contact_Name",contact.get("id"));
}
paramap.put("Terms_and_Conditions",ifnull(respMap.get("Terms_and_Conditions"),""));
paramap.put("Description",ifnull(respMap.get("Description"),""));
paramap.put("Adjustment",ifnull(respMap.get("Adjustment"),"0.0").toDecimal());
paramap.put("Discount",ifnull(respMap.get("Discount"),"0.0").toDecimal());
paramap.put("Maker Price",ifnull(respMap.get("maker_price"),"0.0").toDecimal());
paramap.put("Wholesale Price",ifnull(respMap.get("wholesale_price"),"0.0").toDecimal());
createResp = zoho.crm.createRecord("Purchase_Orders",paramap);
info createResp;
return "Sales order successully converted to Purchase Order";
}


        • Recent Topics

        • Before Going To The Qc stage , site ready ness file upload mandtoty how to achive this in the blue print transition

          Before Going To The Qc stage , site ready ness file upload mandtoty how to achive this in the blue print transition On click of the Predelivery transition can we show site ready ness file upload mandtoty or on click of the QC show the alert message site
        • Note cards are duplicating

          Hi, I've been using this app for some time and love it. Recently I've noticed that upon closing a note card, it creates a duplicate. If I exit the notebook it's in and go back, everything is back to normal. Not a major issue but still a little annoying.
        • Where is the (Bulk) Notes Export function from Notebook ???????

          I have seen various threads over the last two years on this and basically no action from ZOHO at all ! BTW having to go to an individual note and export to PDF (which now doesn't even work ) or some sort of zoho format is by no means the answer ! I still can't see any sort of bulk (or even individual) export function across notes. This is really poor for a notes product that is nearly 4 years old from a "major vendor".  I now have a large number of notes (some with images) that I want to export and
        • Again about the backlighting of the search query when searching in a client for Linux

          Some time passed, I installed a client for Linux version 3.4.0, but I still did not receive the promised search with the backlighting of the search query how it was implemented in the client for android. In the previous topic, you told me that this function
        • Enhancements to finance suite integrations

          Update: Based on your feedback, we’ve updated the capabilities for integration users. In addition to the Estimates module, they can now create, view, and edit records in all the finance modules including Sales Order, Invoices, Purchase Order. We're also
        • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

          Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
        • Add views to new CRM UI navigation + Unlimited Webtabs

          Zoho CRM is so close now to being the ultimate business application with the new UI, as soon as this one feature is added. This is probably where Zoho is headed but if it's not I want to BEG for this to be incorporated. What we need is to be able to put
        • Zoho Mail not working

          Anyone else had the issue where emails wont send from either the desktop CRM or the mail app? It just says "syncing" then "failed". I deleted it and tried to access emails through the CRM on my phone (fold) but they dont show. It seems it is impossible
        • Zoho Commerce B2B

          Hello, I have signed up for a Zoho Commerce B2B product demo but it's not clear to me how the B2B experience would look for my customers, in a couple of ways. 1) Some of my customers are on terms and some pay upfront with credit card. How do I hide/show
        • Flex Your Creativity – A New component to Canvas in Zoho CRM

          Hello Everyone We’re excited to introduce Flex, a new component for Canvas in Zoho CRM! Flex is here to give you greater control over how your data is displayed in your layouts. This component enables responsive layouts that adapt across different screen
        • In the Blue Print Transition requirement received it will show 8 check field in pop up if they any one of this field then only move to next stage Ist quote

          In the Blue Print Transition requirement received it will show 8 check field in pop up if they any one of this field then only move to next stage Ist quote Pls help how i fix this
        • Linking Multi-UOM Barcodes to Products in Zoho Books

          Greetings, I'm using Zoho Books for retail shop and I'm running into a bit of a challenge with products that have multiple Units of Measurement (UOMs) and corresponding barcodes. For example, I sell cigarettes both as individual packets and in cartons
        • Convert Item to composite item

          When using Zoho CRM integrated with Zoho Inventory/Books, the item creation process is a little messy. After a few years of trial and error, we have settled on creating items in CRM, which are sync'ed to Zoho Inventory using Zoho's own internal integration.
        • What’s New in Zoho Inventory | April 2025

          Hello users, April has been a big month in Zoho Inventory! We’ve rolled out powerful new features to help you streamline production, optimise stock management, and tailor your workflows. While several updates bring helpful enhancements, three major additions
        • Mapping “Account Name” from CRM to Campaigns

          I’m syncing our Contacts list to Campaigns and want to select “Account Name” as an available field. Account Name does not appear in the drop down menu for CRM field even though Account Name is a field in our standard layout. How can I make it availa
        • Zoho Campaigns to Zoho Analytics Sync Fails – Field Mapping Shows But Not Applied

          I’m facing a persistent issue with the Zoho Campaigns integration to Zoho Analytics in my workspace. Here’s a detailed description of the problem: Under Edit Setup, I see a field mapping summary that shows: DataField Mapping: Most Recent Login However,
        • How to link web sales payments through Stripe to invoices?

          I have just set up an online shop website which accepts payments through Stripe.  The payment appears in Zoho Books through the Stripe feed as 'Sales without invoices'.  In order to keep Zoho Inventory in step, I manually (for now) create a Sales Invoice
        • Partially receive PO without partial Bill?

          Most of our inventory is pre-paid. Let's say we purchase 30 pieces of 3 different items for a total of 90 pieces. It is common for our supplier to send us the items as they are ready. So we will receive 30 pieces at a time. How can I partially receive
        • 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
        • Zoho People & Zoho CRM Calendar

          Hi, Does anyone know if it is possible to link Zoho People and the calendar in CRM? I would like when holidays are approved they automatically appear in the calendar on CRM. Thanks 
        • Secure your external sharing process with OTP Authentication

          For any business, it's crucial to share files externally in a way that is both secure and controlled. Let's say you want to share confidential data with your partners and vendors. You must ensure that only your intended recipients can access the shared
        • Currency transition

          We are using Zoho CRM in Curacao, Dutch Caribbean. Our currency is currently the ANG. Curacao will be transition ing from using the ANG (Antillean Guilder) to using the XCG currency (Caribbean Guilder) on March 31st 2025, see: https://www.mcb-bank.com/caribbean-guilder.
        • Reply to email addresses wrong.

          I have setup my Zoho mail account using my main domain and I also have an Alias setup from a different domain. In Settings - Mail - Compose I have selected to the option "For replies, send using The same email address to which the email was sent to". This seems to work perfectly, except that the email always sends the email with a Reply To email address from the main domain not the alias. This can be changed in the Reply To drop down box to the right of the From Address in the email, but I obviously
        • Multiple images, one record

          I have a form that is used to capture the following info: -Facility Name -Origin -Shipment # -Picture of Damaged Pallet (Image field) I want to be able to capture multiple pictures without having to create a new record, as there might be multiple damaged pallets on the shipment. Obviously, one never knows how many damaged pallets might be on a shipment so I'd prefer not to create 20 image fields and have most of them unused.  I'd prefer that they have an option to add another image only if they need
        • how to dynamically upload multiple images for single record?

          Is the use of dynamic multiple images in a single record supported? I've searched but have not found the answer. If it is supported, how is it done? I saw 1 suggestion to add a sub-form but that doesn't seem to be the answer. I don't want to add a set number of image fields. Each record would have a different number of images. I want the addition of images to be dynamic. thanks
        • Multi-upload field

          Hi I need to include a file upload field that allows the user to select multiple files and upload all at once. I hope I can do this with HTML, I'm new to merging HTML and deluge... Can I trigger a hidden file upload window to appear On User Input of a field in an embedded form? Thanks! Levi
        • is it possible to add multiple attachments to a record?

          Hello, I'm trying to add functionality so that a record can have several associated attachments. I obviously added a File Upload field to my form, but that appears to only allow one total. Is there a way around this? Thanks, - Kevin
        • multiple upload files in zoho form

          Hi,  I need upload multiple files  in a single upload field thkns
        • Multi file upload

          Hi, I just wonder if one could upload multiple files in one shot, say between one and three files, without adding multiple File Upload fields? Thanks, Alalbany
        • Copying records from a Custom Module into Deals

          Hello, I recently created a custom module to handle a particular type of order/transaction in our business. Having got this up and running I've realised that it would be much better to use the Deals module with a different layout instead. We've entered
        • How to rename the Submit Button by using deluge script

          Hi everyone, As we know, the Submit button can be renamed in the form builder setting. But I have scenario where I need the Submit Button to be renamed differently according to condition. Anyone knows how to do it? Thank You
        • Zoho Inventory Feature Roadmap Visible To All

          Hello, please consider making your feature roadmap visible to us users so that we know what to expect in future. This may appease current users who are seeking clarification on feature implementation dates, so that they can make an informed decision whether
        • Detail View in Mobile without Labels

          Zoho creator 6. I have been trying to acheieve this but not able to. I have a quick view of my articles using custom layout for mobile. When i tap on an article it opens in detail view on my mobile which has two cols. Left displays label and right the
        • Upcoming Changes to LinkedIn Parsing in Resume Extractor

          Starting 31 July 2025, the Zoho Recruit Resume Extractor will no longer support direct parsing of candidate data from LinkedIn profiles. Why Is This Change Needed? In accordance with LinkedIn’s platform policies, extracting profile data through browser
        • Can't find parent child ticketing

          Hi I can't find parent child ticketing under tickets in this new organization... I have in the past on other organizations
        • What's New in Zoho Invoice | April - June 2025

          Hello everyone! We're excited to share the latest feature updates and enhancements we've made to Zoho Invoice from April to June 2025. In this, you will learn more about the following features: New Integrations via Zoho Marketplace Add Images to Email
        • Keeping Track of Email Threads

          Hi, Z CRM is great for tracking all the activities one would want to track whilst qualifying leads, converting to customers, closing deals etc etc, however.... ....although I can use Z CRM to send an email to a lead/contact and have that recorded as an activity for other team members to see, there is no way of capturing an inbound email from that lead. Assume my lead replies to my email sent from ZCRM, in my case, the response arrives in my ZMail account. However I can't get it back into ZCRM to
        • Zoho Creator invokeUrl to retreive PDF

          I'm trying to retreive a record PDF to send to Print Node. Tried with and without the zoho_creator_connection. pdf_content = invokeurl [ url :"https://creatorapp.zoho.com.au/<org_namespace>/<app_link_name>/record-pdf/<report_link_name>/" + input.ID type
        • Bulk upload image option in Zoho Commerce

          I dont know if I am not looking into it properly but is there no option to bulk upload images along with the products? Like after you upload the products, I will have to upload images one by one again? Can someone help me out here? And what should I enter
        • How to Automate Monthly PDF Reports with Filters in Zoho Creator

          Hi everyone, I’m trying to build an automated monthly reporting process in Zoho Creator and would appreciate suggestions or best practices from anyone who has done something similar. What I’m trying to do: I have a form called New_Customer with fields
        • Next Page