Hi Guys , I need help. All of a sudden. NetSuite d...
# suitescript
n
Hi Guys , I need help. All of a sudden. NetSuite doesnt return the createdby field valie on the JEs . One of my scripts was dependent on that. Can someone help?
e
How do you get it? Share code.
n
function getCreatedByUserId(journalEntryId) {
var journalEntrySearch = search.create({
type: search.Type.JOURNAL_ENTRY,
filters: [
['internalid', 'is', journalEntryId]
],
columns: [
'createdby'
]
});
var searchResult = journalEntrySearch.run().getRange({
start: 0,
end: 1
});
if (searchResult.length > 0) {
return searchResult[0].getValue('createdby');
}
return null;
}
??
e
If you test a hardcoded value for the JE, do you get the expected result? The code is fine.
t
Just giving some debugging ideas: maybe a inactivated employee? maybe you've pulled from the set of journals created by system? maybe its the permission on the deployment for the execute as?
n
Thanks for the reply. I will check that.