We designed the CRM to have the Potentials als Opportunities. Now, when we loose a opportunity, we would like to either make an automated workflow, that when an opportunity is set to lost, to close all quotes and tasks, or make i via Blueprint and a "one-button" solution.
Here is my current script for the quotes (it is my first own script, so it might be very bad :D)
potIdStr = potId.toString();
relatedQuote = zoho.crm.getRelatedRecords("Quotes","Potentials",potIdStr,1,200);
mapVariable = Map();
for each quote in relatedQuote
{
quoteID = ifnull(quote.get("Angebotsnummer"),"");
status = ifnull(quote.get("Quote Stage"),"");
if(status != "Abgeschlossen, verloren")
{
mapVariable.put("Status","Abgeschlossen, verloren");
updateQuote = zoho.crm.updateRecord("Quotes",quoteID,mapVariable);
info updateQuote;
}
}
Any idea on how to make it work?
Alle Best