Slig
03/21/2022, 3:36 PMCD
03/21/2022, 3:42 PMSlig
03/21/2022, 4:18 PMSlig
03/21/2022, 4:18 PMSlig
03/21/2022, 4:19 PMfunction createNote(installment, recordId, userId, error, occurrence) {
var title = '';
var memo = '';
var transaction = record.load({ type: record.Type.INVOICE, id: id, isDynamic: true });
var tranid = transaction.getText({ fieldId: 'tranid' }); //peguei o valor de tranid
if (error) {
if (installment) {
title = 'Parcela ' + installment.id;
memo = 'Parcela ' + installment.id + ' - Transação ' + installment.transaction + 'n° Fatura: ' + tranid + ' - Erro: ' + error.error;
} else {
title = 'Parcela não identificada';
memo = 'Erro antes de identificar a parcela - Linha do arquivo: ' + error.line + 'n° Fatura: ' + tranid + ' - Erro: ' + error.error;
}
} else {
title = 'Parcela ' + installment.id;
memo = 'Parcela ' + installment.id + ' - Transação ' + installment.transaction + 'n° Fatura: ' + tranid + ' - Parcela processada com sucesso - Ocorrência ' + occurrence.name;
}
var note = record.create({ type: 'note', isDynamic: true });
note.setValue({ fieldId: 'recordtype', value: getRecordTypeId(), ignoreFieldChange: true });
note.setValue({ fieldId: 'record', value: recordId, ignoreFieldChange: true });
note.setValue({ fieldId: 'title', value: title, ignoreFieldChange: true });
note.setValue({ fieldId: 'note', value: memo, ignoreFieldChange: true });
note.setValue({ fieldId: 'author', value: userId, ignoreFieldChange: true });
note.save();
}
Slig
03/21/2022, 4:20 PMSlig
03/21/2022, 4:20 PMvar transaction = record.load({ type: record.Type.INVOICE, id: id, isDynamic: true });
var tranid = transaction.getText({ fieldId: 'tranid' });
Zack
03/21/2022, 4:48 PMvar tranid = transaction.getValue({ fieldId: 'tranid' });
as well?Slig
03/21/2022, 4:58 PMZack
03/21/2022, 4:59 PMSlig
03/21/2022, 6:23 PMfunction createNote( installment, recordId, userId, error, occurrence, context )
{
var title = '';
var memo = '';
var rec = context.newRecord;
var transRec = record.load({type: rec.type, id: rec.id});
var tranid = transRec.getText({field: 'tranid'});
if( error ) {
if (installment) {
title = 'Parcela ' + installment.id;
memo = 'Parcela ' + installment.id + ' - Transação ' + installment.transaction + ' - n° Fatura: ' + tranid + ' - Erro:' + error.error;
} else {
title = 'Parcela não identificada';
memo = 'Erro antes de identificar a parcela - Linha do arquivo: ' + error.line + ' - n° Fatura: '+ tranid +' - Erro: ' + error.error;
}
} else {
title = 'Parcela '+installment.id;
memo = 'Parcela '+installment.id+' - Transação '+ installment.transaction+' - Parcela processada com sucesso - Ocorrência '+ occurrence.name;
}
var note = record.create({ type: 'note', isDynamic: true });
note.setValue({ fieldId: 'recordtype', value: getRecordTypeId(), ignoreFieldChange: true });
note.setValue({ fieldId: 'record', value: recordId, ignoreFieldChange: true });
note.setValue({ fieldId: 'title', value: title, ignoreFieldChange: true });
note.setValue({ fieldId: 'note', value: memo, ignoreFieldChange: true });
note.setValue({ fieldId: 'author', value: userId, ignoreFieldChange: true });
note.save();
}
Zack
03/21/2022, 6:25 PMfunction createNote( installment, recordId, userId, error, occurrence, context )
{
var title = '';
var memo = '';
var rec = context.newRecord;
var transRec = record.load({type: rec.type, id: rec.id});
var tranid = transRec.getValue({field: 'tranid'});
//CHANGED THIS ^
if( error ) {
if (installment) {
title = 'Parcela ' + installment.id;
memo = 'Parcela ' + installment.id + ' - Transação ' + installment.transaction + ' - n° Fatura: ' + tranid + ' - Erro:' + error.error;
} else {
title = 'Parcela não identificada';
memo = 'Erro antes de identificar a parcela - Linha do arquivo: ' + error.line + ' - n° Fatura: '+ tranid +' - Erro: ' + error.error;
}
} else {
title = 'Parcela '+installment.id;
memo = 'Parcela '+installment.id+' - Transação '+ installment.transaction+' - Parcela processada com sucesso - Ocorrência '+ occurrence.name;
}
var note = record.create({ type: 'note', isDynamic: true });
note.setValue({ fieldId: 'recordtype', value: getRecordTypeId(), ignoreFieldChange: true });
note.setValue({ fieldId: 'record', value: recordId, ignoreFieldChange: true });
note.setValue({ fieldId: 'title', value: title, ignoreFieldChange: true });
note.setValue({ fieldId: 'note', value: memo, ignoreFieldChange: true });
note.setValue({ fieldId: 'author', value: userId, ignoreFieldChange: true });
note.save();
}
Zack
03/21/2022, 6:32 PMSandii
03/21/2022, 6:37 PMSlig
03/21/2022, 7:51 PMNElliott
03/22/2022, 10:45 AMSlig
03/22/2022, 4:58 PMNElliott
03/22/2022, 5:22 PM