FAgudelo
07/29/2025, 7:45 PMnetsuiteforstrongmen
07/30/2025, 8:44 AMlet document = record.load({ type: documentType, id: requestBody.id, isDynamic: false });
if (isSuiteTaxEnabled) {
document.setValue('taxdetailsoverride', true);
}
items.forEach((item, index) => {
if (item.taxCode !== undefined && item.taxCode !== null) {
document.setSublistValue({
sublistId: 'taxdetails',
line: index,
fieldId: 'taxamount',
value: item.taxAmount,
});
document.setSublistValue({
sublistId: 'taxdetails',
line: index,
fieldId: 'taxbasis',
value: item.amount,
});
document.setSublistValue({
sublistId: 'taxdetails',
line: index,
fieldId: 'taxcode',
value: item.taxCode,
});
}
});
Thank you in advance for your support.Zoran R-DATAGRAM
07/30/2025, 10:47 AMNicolas Daniel Villalba
07/30/2025, 3:22 PMrecord.create
or record.transform
fails. Both methods try to load all open invoices into the apply
sublist, which hits the ~10,000 record governance limit. This makes it impossible to find and apply the payment to the correct invoice if it's not in that first batch.
Failed Attempts:
• Loading the Payment: Fails due to the 10k limit.
• Loading the Invoice: Fails due to a timing issue (the invoice doesn't "see" the newly created payment to apply it).
What is the recommended architecture for this scenario?
Thanks for your help!Armanda
08/01/2025, 1:58 AMDavid Na
08/04/2025, 7:18 AMresponse.sendRedirect({
type: 'SUITELET',
id: 'customdeploy_tpp_su',
identifier: 'customscript_tpp_su',
parameters: {
custparam_action: 'dashboard',
custparam_sessionid: sessionId
}
});
All IDs, are ok.
Suitlet is "Available without login"Shelby Owens
08/05/2025, 3:11 PMChris
08/05/2025, 3:37 PMrecord.copy
, is it possible to edit the subsidiary on the resulting pre-filled form?Ty
08/05/2025, 5:45 PMPrashant Kala
08/06/2025, 5:20 PMCraig
08/07/2025, 11:00 AMJC
08/07/2025, 12:40 PMNotice (SuiteScript)
errors recently? I've seen those across 4 accounts already.JBL
08/08/2025, 1:58 AMPradeep Kumar
08/09/2025, 7:37 AMEmanuel V
08/12/2025, 4:56 AM""type":"error.SuiteScriptError","name":"_1_2_IS_UNDER_CONSTRUCTION","message":"Job ACME : 1078 To Be Generated : ACME is under construction!""
William Rodriguez
08/12/2025, 3:03 PMeblackey
08/12/2025, 9:13 PMMarvin
08/13/2025, 6:55 AMSagar Hiray
08/13/2025, 1:42 PMAlexander Cuadros
08/13/2025, 6:11 PMericbirdsall
08/13/2025, 7:29 PMSim Greenbaum
08/14/2025, 6:57 PMNSN
08/14/2025, 7:22 PMeblackey
08/14/2025, 8:23 PMAbdul Qadeer
08/15/2025, 9:44 AMTy
08/15/2025, 10:36 PMLuis
08/17/2025, 4:19 AMLuis
08/17/2025, 4:20 AM/**
* @NApiVersion 2.1
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(['N/record', 'N/runtime', 'N/search', 'N/log'],
(record, runtime, search, log) => {
const beforeSubmit = (scriptContext) => {
if (scriptContext.type !== scriptContext.UserEventType.CREATE && scriptContext.type !== scriptContext.UserEventType.EDIT) {
`log.debug('Debug', Script did not run for event type: ${scriptContext.type}. Exiting.
);`
return;
}
const newRecord = scriptContext.newRecord;
const subsidiaryId = newRecord.getValue({
fieldId: 'subsidiary'
});
if (!subsidiaryId) {
log.debug('Debug', 'No subsidiary found on the record. Exiting.');
return;
}
try {
const subsidiaryFields = search.lookupFields({
type: record.Type.SUBSIDIARY,
id: subsidiaryId,
columns: ['country']
});
const subsidiaryCountryValue = subsidiaryFields.country[0].value;
`log.debug('Debug', Subsidiary country is: ${subsidiaryCountryValue}
);`
if (subsidiaryCountryValue !== 'US') {
log.debug('Debug', 'Subsidiary country is not USA. Exiting.');
return;
}
const locationId = newRecord.getValue({
fieldId: 'location'
});
if (!locationId) {
log.debug('Debug', 'No location found on the record. Exiting.');
return;
}
const locationFields = search.lookupFields({
type: record.Type.LOCATION,
id: locationId,
columns: [
'address1', 'address2', 'city', 'state', 'zip', 'country'
]
});
log.debug('locationFields ', JSON.stringify(locationFields));
const shippingAddressSubrecord = newRecord.getSubrecord({
fieldId: 'shippingaddress'
});
shippingAddressSubrecord.setValue({
fieldId: 'country',
value: locationFields.country[0].value
});
shippingAddressSubrecord.setValue({
fieldId: 'city',
value: locationFields.city
});
shippingAddressSubrecord.setValue({
fieldId: 'state',
value: locationFields.state
});
shippingAddressSubrecord.setValue({
fieldId: 'zip',
value: locationFields.zip
});
shippingAddressSubrecord.setValue({
fieldId: 'addr1',
value: locationFields.address1
});
if(locationFields.address2) {
shippingAddressSubrecord.setValue({
fieldId: 'addr2',
value: locationFields.address2
});
}
`log.audit('Success', Ship-to address updated from location record for Invoice ID: ${newRecord.id || 'New Record'}
);`
} catch (e) {
log.error({
title: 'Error copying location address',
details: e.toString()
});
}
};
return {
beforeSubmit: beforeSubmit
};
});
Vishal Chaudhari
08/18/2025, 2:05 PMArham Momin
08/18/2025, 7:19 PMrecordObj.getFields()
, but it only returns the IDs of fields that contain values. How can I retrieve all field IDs, including empty ones?