Schwifty
10/25/2021, 5:34 AMbattk
10/25/2021, 9:22 AMSchwifty
10/25/2021, 9:29 AMvar lineCount = objRecord.getLineCount({"sublistId": "timeitem"});
var recSublist = objRecord.getSublist({sublistId: 'timeitem'})
var custpage_clientContractField = objSublist.addField({
id : 'custpage_clientcontract',
type : serverWidget.FieldType.SELECT,
label: 'Client Contract'
})
var nativeCustomerAgreement = scriptContext.newRecord.getSublistValue({
sublistId: "timeitem",
fieldId: "custcolrt_timesheet_client_contract",
line: 0
});
log.debug('native field', nativeCustomerAgreement)
var custcolCustomerAgreement = scriptContext.newRecord.getSublistValue({
sublistId: "timeitem",
fieldId: "custpage_clientcontract",
line: 0
});
log.debug('custom field', custcolCustomerAgreement)
scriptContext.newRecord.setSublistValue({
sublistId: 'timeitem',
_`fieldId: 'custpage_clientcontract',`_
value: nativeCustomerAgreement,
line: 0,
ignoreFieldChange: true
battk
10/25/2021, 9:31 AMbattk
10/25/2021, 9:35 AMbattk
10/25/2021, 9:36 AMSchwifty
10/25/2021, 9:54 AMSchwifty
10/25/2021, 9:55 AMbattk
10/25/2021, 9:57 AMSchwifty
10/25/2021, 9:57 AMbattk
10/25/2021, 9:58 AMSchwifty
10/25/2021, 9:59 AMSchwifty
10/25/2021, 10:06 AMbattk
10/25/2021, 10:07 AMSchwifty
10/25/2021, 10:08 AMbattk
10/25/2021, 10:08 AMSchwifty
10/25/2021, 10:10 AMsublist.insertSelectOption({
value: clientAgreementID,
text: clientAgreementName,
});
Schwifty
10/25/2021, 10:19 AMbattk
10/25/2021, 10:21 AMSchwifty
10/25/2021, 10:25 AMSchwifty
10/25/2021, 10:25 AMif (!nativeCustomerAgreement) {
log.debug('condition inside', 'native field is empty')
} else {
log.debug('condition inside', 'native field is not empty')
custpage_clientContractField.addSelectOption({
value: 'b',
text: 'AAAA'
// ignoreFieldChange: true
})
objSublist.setSublistValue({
id: 'custpage_clientcontract',
line: 0,
value: custpage_clientContractField
})
}
battk
10/25/2021, 10:26 AMcustpage_clientContractField
is a serverWidget.Fieldbattk
10/25/2021, 10:27 AMSchwifty
10/25/2021, 10:28 AMbattk
10/25/2021, 10:29 AMSchwifty
10/25/2021, 10:32 AMSchwifty
10/25/2021, 10:33 AMbattk
10/25/2021, 10:33 AMSchwifty
10/25/2021, 10:35 AM