Hello, everyone. I'm trying to create a customer p...
# general
a
Hello, everyone. I'm trying to create a customer payment from an invoice in a Suitelet using the
record.transform
module. However, I'm encountering issues with the date (
trandate
) of the payment. It seems to be attempting to use today's date, and the accounting period isn't open yet. I tried passing the value of December 31st to avoid this, but it's giving me an error with that value. Does anyone know why? Has anyone encountered this error before? the code is this: var defaultDate = new Date('12/31/2023'); var fecha = new Date(defaultDate); // Obtener los componentes de la fecha var dia = fecha.getUTCDate(); var mes = fecha.getUTCMonth() + 1; // Sumar 1 porque los meses en JavaScript son indexados desde 0 var anio = fecha.getUTCFullYear(); // Formatear la fecha al formato DD/MM/AAAA var fechaFormateada = (dia < 10 ? '0' : '') + dia + '/' + (mes < 10 ? '0' : '') + mes + '/' + anio; log.audit("fechaFormateada", fechaFormateada); log.audit("formattedDate", defaultDate); var objRecord3 = record.transform({ fromType:'invoice', fromId: listId, toType: 'customerpayment', defaultValues: { trandate: fechaFormateada} }); [22:39] the erros is this: error.SuiteScriptError","name":"INVALID_RCRD_TRANSFRM","message":"You have entered an invalid default value for this record transformation operation.","id":"","stack":["anonymous(N/recordImpl)",