I want to perform data updates based on data that is in a DE, if the Contact_Id of the case is the same as what is in the DE then perform the modifications that are in the variables
but when I run the script there is no change to the case in Salesforce and it remains pending (and does not change to Completed Service and then closes the case) what am I doing wrong?
Platform.Load("Core", "1.1.1");
try {
var closeReason = "Aluno realizou o pagamento do feirão";
var status = "Atendimento Concluído";
var deCustomerRows = DataExtension.Retrieve("Base_pagamentos_feirão", ["Contact_Id"]);
if (deCustomerRows && deCustomerRows.length > 0) {
for (var i = 0; i < deCustomerRows.length; i++) {
var contactId = deCustomerRows[i]["Contact_Id"];
var updateResult = Platform.Function.UpdateSingleSalesforceObject(
"Case", contactId,
["CloseReason__c", "Status", "IsClosed"],
[closeReason, status, "true"]
);
}
}
} catch (e) {
// Lidar com erros, se necessário
}