Joe
03/21/2025, 6:06 PMCeligo AI
03/21/2025, 6:08 PMAI generated answer (using internal Slack threads):To populate a custom text field with the id of the selected option in a dropdown, you can use SuiteScript. Here's a general idea of how you can do it: 1. Create a client script that will be triggered when the dropdown field is changed. 2. In the fieldChanged function of the client script, get the value of the dropdown field. 3. Set the value of the custom text field with the value obtained from the dropdown field. Here's a sample SuiteScript code:
javascript
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
*/
define(['N/currentRecord'], function(currentRecord) {
function fieldChanged(context) {
if (context.fieldId === 'your_dropdown_field_id') {
var dropdownValue = context.currentRecord.getValue({
fieldId: 'your_dropdown_field_id'
});
context.currentRecord.setValue({
fieldId: 'your_custom_text_field_id',
value: dropdownValue
});
}
}
return {
fieldChanged: fieldChanged
};
});
Please replace 'your_dropdown_field_id' and 'your_custom_text_field_id' with your actual field IDs.
Remember to attach this client script to your record type.
******
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
03/21/2025, 6:08 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819934666
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814745247
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.812290251
Celigo AI
03/21/2025, 6:08 PMJoe
03/21/2025, 6:10 PMSELECT * FROM transaction
using SuiteQL my custom field will get the scriptid or name and not the internal id of the selected record?