Imen
10/16/2024, 5:25 PMCeligo AI
10/16/2024, 5:26 PMAI generated answer (using internal Slack threads):To preserve the field value when changing the form in the same record, you can use a client script to store the value in a global variable when the field changes. Then, when the form changes, you can use the stored value to restore the field. Here's a simplified example:
javascript
var fieldValue;
function fieldChanged(context) {
if (context.fieldId === 'your_field_id') {
fieldValue = context.currentRecord.getValue({fieldId: 'your_field_id'});
}
}
function pageInit(context) {
if (fieldValue) {
context.currentRecord.setValue({fieldId: 'your_field_id', value: fieldValue});
}
}
In this example, fieldChanged
is a function that runs when a field value changes. It checks if the field that changed is the one you're interested in, and if so, it stores the value in the fieldValue
variable. pageInit
is a function that runs when the page is initialized. If fieldValue
has a value, it sets the value of the field to fieldValue
.
Please note that this solution assumes that the field value needs to be preserved during the same session. If you need to preserve the value across sessions, you might need to store the value in a custom field or a custom record.
******
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
10/16/2024, 5:26 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823069811
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.822228
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819766879
Celigo AI
10/16/2024, 5:26 PM