I have a workflow made when a quote is edited the quote number will be copied to a text field Quote_number_ref in the deal that it is associated with. This is the function, it says successful in view usage but Deal field is never populated. Any ideas?
- // Fetch the Quote's details using the Quote ID
- quoteId = input.quoteId;
- quoteDetails = zoho.crm.getRecordById("Quotes",quoteId);
- // Get the Quote Number and associated Deal ID
- quoteNumber = quoteDetails.get("Quote_Number");
- // Replace with your actual Quote Number field API name
- dealId = quoteDetails.get("Deal_Name.id");
- // Replace "Deal_Name" with the actual API name of the lookup field that links the Quote to a Deal
- // If there's an associated Deal
- if(dealId != null)
- {
- // Create a map to store the Deal update data
- dealData = Map();
- dealData.put("Quote_Number_Ref",quoteNumber);
- // Replace "Quote_Number" with the actual API name of the custom field in the Deals module where you want to store the Quote Number
- // Update the Deal record with the Quote Number
- updateDeal = zoho.crm.updateRecord("Deals",dealId,dealData);
- }
}