Kevin Baxter
09/27/2023, 2:58 PMKevin Baxter
09/27/2023, 2:58 PMThorne Perun
10/09/2023, 6:23 PMGurudeep Naik
10/10/2023, 10:01 AMJahangir Bin Tayyab Hussain
10/13/2023, 10:39 AMIzzy
10/17/2023, 11:31 PMTim Chapman
10/27/2023, 3:14 PMUser2351
10/31/2023, 12:47 AMMilcho Dimkov
10/31/2023, 3:31 PMNetsuite Tragic
11/06/2023, 11:05 AMif (context.type !== context.UserEventType.CREATE && context.type !== context.UserEventType.EDIT) {
return; // Only run on creation or editing of Vendor Payment record
}
var newRecord = context.newRecord;
var vendorPaymentMemo = '';
var paidBills = [];
// Get the paid vendor bills linked to this vendor payment
var lineCount = newRecord.getLineCount({ sublistId: 'apply' });
for (var i = 0; i < lineCount; i++) {
if (newRecord.getSublistValue({ sublistId: 'apply', fieldId: 'apply', line: i })) {
var paidBill = newRecord.getSublistValue({ sublistId: 'apply', fieldId: 'doc', line: i });
if (paidBill && paidBills.indexOf(paidBill) === -1) {
paidBills.push(paidBill);
}
}
}
// If paid bills were found, construct the vendor payment memo
if (paidBills.length > 0) {
var billSearch = search.create({
type: search.Type.VENDOR_BILL,
filters: [['internalid', 'anyof', paidBills],'AND',
['mainline', 'is', 'T']],
columns: ['tranid']
});
var results = billSearch.run().getRange({ start: 0, end: 1000 }); // Limit to 1000 bills
for (var i = 0; i < results.length; i++) {
vendorPaymentMemo += results[i].getValue({ name: 'tranid' }) + ', ';
}
vendorPaymentMemo = vendorPaymentMemo.slice(0, -2) // Remove the final ', '
// Set the vendor payment memo
newRecord.setValue({ fieldId: 'memo', value: vendorPaymentMemo });
Thorne Perun
11/09/2023, 7:10 PMDavid Durst
11/15/2023, 9:31 AMKristy Kapsner
11/27/2023, 6:38 PMBrandon Hunt
11/30/2023, 7:40 PMNeeranie Ramdas
12/01/2023, 12:44 AMStuart Anderton
12/06/2023, 7:50 PMSergio Ruiz
12/14/2023, 9:35 AMNawarain
12/18/2023, 11:44 AMAnas Jakwani
12/22/2023, 10:36 AMAnas Jakwani
12/28/2023, 10:39 AMKman
01/02/2024, 4:57 PMKman
01/04/2024, 12:19 PMJacob D
01/04/2024, 7:07 PMIsrael Gonzalez
01/09/2024, 6:04 PMGMR Admin
02/13/2024, 6:23 PMAaron Lozier
02/22/2024, 9:58 PMInternalId,1,2,3,4
10495,5101079,4991422,8356092,8356116
Aaron Lozier
02/22/2024, 9:59 PMInvalid storedisplayimage reference key "5101079"
Aaron Lozier
02/22/2024, 9:59 PMAaron Lozier
02/22/2024, 10:00 PMInternalId,1,2,3,4
10495,/Images/D.A.M. product images/10495.1.jpg,/Images/D.A.M. product images/10495.2.jpg,/Images/D.A.M. product images/10495.3.jpg,/Images/D.A.M. product images/10495.4.jpg
Gaurav Maheshwari
03/08/2024, 7:34 AM