Hello, why does this error return? org.mozilla.ja...
# suitescript
s
Hello, why does this error return? org.mozilla.javascript.EcmaError: TypeError: Cannot find function get in object Wed Sep 08 2021 000000 GMT-0700 (PDT). (/SuiteScripts/altera_data_ue.js#52)
//define transDueDate com a data de atual
var transDataPrevista = new Date("09/08/2021");
//formata a data com a biblioteca moment
var newDataPrevista = transDataPrevista.setDate(90);
//formata o objeto newDueDate para o tipo DATE(DATA)
var newAcceptableDate = format.format({
value: newDataPrevista,
type: format.Type.DATE
})
//define a nova data para duedate
curRec.setValue({
fieldId: 'custrecord_gf_data_prevista',
value: newAcceptableDate,
ignoreFieldChange: true //opcional, o padrão é false
});
}
b
something is trying to call a get function that doesnt exist
probably around line 52
s
Oh, yes, i'm sorry. Thank you
Hey @battk Just answer me this: Is it possible to change the duedate this way I'm doing? Or is it not possible at all to make this change?
Because netsuite does not change the registration date in any way. It does not return any error, but remains unchanged; If there's no way to change, that's fine, that's all I need to know. and thank you too
b
its possible, its just that I would only describe
var transDataPrevista = new Date("09/08/2021");
as the only line of code thats helping you to make the change
every other statement is not helping
s
var transDatePrevista = new date ("09/08/2021"); So you suggest deleting all the code, writing a new one and working only with this variable?
Correct me if I'm wrong, can't you change the duedate that way then? I need to set the date, right?
b
you can change the date, just not with the code you have
its doing multiple things wrong
again, you probably want to learn how to update an easy text field like the memo
start from there and build up code that will do what you want
s
hmm, I understand. Thanks again.
b
if you are still using an afterSubmit entrypoint, then you should go through the documentation of afterSubmit to make sure you understand the limitations on
scriptContext.newRecord
😄 1
s
Okay! Thanks 😄
"how to update an easy text field like the memo" Where do I see on this subject?
b
❤️ 1
s
Thanks, bro