Concatenate two fields into one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2022 06:45 AM
Im trying to copy the value of two different fields into one when a value is selected from a reference field.
when a value is selected form a reference field, I would like to push that value along with the value in another field to a field where both values will be concatenated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2022 06:58 AM
Use an onChange client script on your reference field, get the display value, get the value of your other field, and use g_form.setValue('other_field',val1 + val2); for your final concatenated field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2022 06:59 AM
Hi,
Assuming you have 2 fields
1 - Field A - String
2 - Field B - Reference
3 - Field C - This will hold the concatenated value
On change of field B write a client script that
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
g_form.setValue('<field C>', g_form.getDisplayBox('<field B>').value + ' ' + g_form.getValue('Field A'));
}
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2022 07:07 AM
Is Field A editable on the form too? If so, the onChange of Field A should call the same code.
Will Field C be editable on the form? If not editable, this whole concatenation should be done in a Business rule on the server side.
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2023 04:54 AM
Hi Anurag,
Can you give me the server side code so on submitting the form the Auto-Number field and the reference field value gets concatenated.
Thanks,
Koushik