Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Don’t miss your chance to meet our SuiteGurus—NetSuite Support professionals and subject matter experts with extensive experience in select product areas, including OneWorld, Advanced & Basic Accounting, Supply Chain Management, Receivables & Payables, CRM, Account Administration, and the SuiteCloud Platform. Full Conference attendees can prebook exclusive 30-minute one-on-one sessions for your product questions.
Spots are limited! Register through your Agenda Builder and find SuiteGuru under Agenda Enhancements.
Get the lineCount of attachements and notes
Goodafternoon,
is there a way to get the lineCount from attachment (mediaitem) and the notes('note')?
I wanted to create a script, that if there are any attachments and/notes a field get true, so the users can quickly see if there are any attachements and/or notes. before checking communication subtab.
I created below SuiteScript:
const beforeLoad = (context) => {
log.debug('attachment and note script','loaded')
var currentRecord = context.newRecord;
var recType = currentRecord.type.purchaserequisition;
if(context.Type == recType){
let countOfAttachment = currentRecord.getLineCount({
sublistId : 'mediaitem',
});
let countOfNotes = currentRecord.getLineCount({
sublistId : 'note',
});
if(countOfAttachment >= 1) {currentRecord.setValue('custbody_xxw_attachement', true)};
if(countOfNotes >= 1) {currentRecord.setValue('custbody_xxw_icn', true)};