创建客户脚本,其中,当用户在账单费用行上输入帐户编号时,请确保对于某些帐户,在保存行时将摊销字段值设置为null(用户输入的内容不会太乱),而对于所有其他帐户则保持原样
function validateLine(scriptContext) {
var bill = scriptContext.currentRecord;
var expAccountVal = bill.getCurrentSublistText({
sublistId: 'expense',
fieldId: 'account',});
var expAmortSchVal = bill.getCurrentSublistText({
sublistId: 'expense',
fieldId: 'amortizationSched',});
if (expAccountVal == 'Prepaid Expenses and Other')
{
bill.setCurrentSublistText({
sublistId: 'expense',
fieldId: 'amortizationSched',
text: ' ',
ignoreFieldChange: true
});
}
}