Internal error to update the stage

Internal error to update the stage

Good morning, 


I am trying to build a function to update stage of a Quote, and independent of what I use as “Deal_name” I receive this message:


{"code":"INTERNAL_ERROR","details":{},"message":"Internal Server Error","status":"error"}


The code that I am using:


quote = Map();

deal = Map();


idQuote = "4214616000003852002";


quote = zoho.crm.getRecordById("Quotes", idProposta);

deal = zoho.crm.getRecordById("Deals", 4214616000003842061);


quote.put("Quote_Stage", "Aguardando Assinatura");


response = zoho.crm.updateRecord("Quotes", idQuote, quote);


dataToChangeStage = Map();

dataDealName = Map();


dataDealName.put("id", deal.get("id"));

dataDealName.put("Amount", quote.get("Sub_Total"));


dataToChangeStage.put("Deal_Name", dataDealName);

dataToChangeStage.put("Frequ_ncia", quote.get("Frequ_ncia"));

dataToChangeStage.put("Forma_de_Pagamento", quote.get("Forma_de_Pagamento"));

dataToChangeStage.put("Vencimento", quote.get("Vencimento"));

dataToChangeStage.put("Login_CPF", quote.get("Login_CPF"));

dataToChangeStage.put("Nome", quote.get("Nome"));

dataToChangeStage.put("E_mail", quote.get("E_mail"));


info dataToChangeStage;


if(response.get("code") == "RECORD_IN_BLUEPRINT")

{

bpGetRes = invokeurl[

url :"https://www.zohoapis.com/crm/v2/Quotes/" + idQuote + "/actions/blueprint"

type :GET

connection:"zohocrm_full_modules"

];


transId = bpGetRes.getJSON("blueprint").getJSON("transitions").getJSON("next_transitions").get(1).get("id");

info transId;


if(transId == "4214616000000325837")

{

info "Entrou no if";


bpPutRes = invokeurl[

url :"https://www.zohoapis.com/crm/v2/Quotes/" + idQuote + "/actions/blueprint"

type :PUT

parameters:"{\"blueprint\": [{\"transition_id\": \""+ transId +"\",\"data\": "+ dataToChangeStage.toString() +"}]}"

connection:"zohocrm_full_modules"

];

info bpPutRes.toString();

}


info "Fim da função";

}


return "";