NickSuite
05/18/2021, 6:54 PMvar sublist = currentRec.getSublist({sublistId: sublistId});
var addrCol = sublistId.getColumn({fieldId: 'custpage_addresses_col'});
but addrCol does not have a function to add select options. Also, I am doing this in fieldChanged event but the doc says CurrentRecord.getSublistField(options) is not valid in fieldChanged events. Any help?battk
05/18/2021, 7:51 PMbattk
05/18/2021, 7:52 PMNickSuite
05/18/2021, 9:13 PMNickSuite
05/18/2021, 9:14 PMbattk
05/18/2021, 9:16 PMbattk
05/18/2021, 9:16 PMNickSuite
05/19/2021, 9:49 AMNickSuite
05/19/2021, 9:49 AMbattk
05/19/2021, 10:05 AMNickSuite
05/19/2021, 11:43 AMbattk
05/19/2021, 12:31 PMNickSuite
05/19/2021, 12:33 PMbattk
05/19/2021, 12:40 PMbattk
05/19/2021, 12:40 PMNickSuite
05/19/2021, 12:40 PMbattk
05/19/2021, 12:41 PMNickSuite
05/19/2021, 12:42 PMbattk
05/19/2021, 12:44 PMfunction validateAndGetOneBasedIndex(index, method, indexUpperLimit)
{
if (isNaN(index))
return index;
else
index = parseInt(index, 10);
if (index < 0 || (indexUpperLimit !== undefined && index >= indexUpperLimit))
{
throw error.create({name: error.Type.INVALID_SUBLIST_OPERATION, message: method});
}
else
{
return index + 1;
}
}
battk
05/19/2021, 12:48 PMfunction getSublistField(options, fieldId, line)
{
var sublistId,
undef = undefined;
if (fieldId !== undef && line !== undef)
{
sublistId = options;
}
else if (options !== undef && options !== null)
{
sublistId = options.sublistId;
fieldId = options.fieldId;
line = options.line;
}
utilityFunctions.checkArgs([sublistId, fieldId, line], ['sublistId', 'fieldId', 'line'], getMissingArgumentErrorMessageFillerValue('getSublistField'));
line = recordUtil.validateAndGetOneBasedIndex(line, "CurrentRecord.getSublistField", nlapiGetLineItemCount(sublistId));
var fldObj = nlapiGetLineItemField(sublistId, fieldId, line);
if (fldObj && fldObj.type === fieldTypeConstants.Type.TEXT && getEncodedFieldType(sublistId, fieldId, true) === fieldTypeConstants.Type.CHECKBOX)
fldObj.type = fieldTypeConstants.Type.CHECKBOX;
fldObj = fixMissingProperties(fldObj);
return fldObj != null ? fieldMetadata.wrap({
delegate: field.create(fldObj),
category: fieldMetadata.Category.CURRENT_SUBLIST
}) : null;
}
battk
05/19/2021, 12:49 PMbattk
05/19/2021, 12:49 PMNickSuite
05/19/2021, 12:51 PMNickSuite
05/19/2021, 12:51 PMbattk
05/19/2021, 12:52 PMNickSuite
05/19/2021, 12:52 PMbattk
05/19/2021, 12:52 PMNickSuite
05/19/2021, 12:53 PM