darrenhillconsulting
11/04/2024, 5:58 PMCeligo AI
11/04/2024, 5:58 PMAI generated answer (using internal Slack threads):When a
custbody
field triggers a fieldChanged
event in a client script, the value passed to the sublistId
is typically the ID of the sublist where the change occurred. However, if the fieldChanged
event is triggered by a change in a body field (like a custbody
field), the sublistId
will be null
because the change did not occur on a sublist.
Here is an example of how the fieldChanged
function might look:
javascript
function fieldChanged(context) {
var currentRecord = context.currentRecord;
var sublistName = context.sublistId;
var sublistFieldName = context.fieldId;
var line = context.line;
if (sublistName === 'item' && sublistFieldName === 'item')
currentRecord.setValue({
fieldId: 'memo',
value: 'Item: ' + currentRecord.getCurrentSublistValue({
sublistId: 'item',
fieldId: 'item'
}) + ' is selected'
});
}
In this example, if the fieldChanged
event is triggered by a change in the item
field on the item
sublist, the sublistId
will be 'item'
. If the fieldChanged
event is triggered by a change in a custbody
field, the sublistId
will be null
.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
11/04/2024, 5:58 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.855744243
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.855521739
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849657
Celigo AI
11/04/2024, 5:58 PM