- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 11:03 AM
Hi,
We have a catalog item where we have a variable set that contain an email field that auto populate with the email of beneficiary.
We also have another hidden field on the catalog item (not on the variable set) where i need to copy that email value.
Someone could help me with this ?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 03:08 PM
Hi Sonali,
The email1 field populate automatically on load form cause the beneficiary is the loggedin user before any change is made.
But nevermind, i found a way to achieve it.
in my onChange script, i made this change and selected the email1 field as the variable name :
g_form.setValue('email_beneficiary',newValue);
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 11:49 AM
What have you tried?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 02:49 PM
I have tried a on change catalog client script on the beneficiary field, so when the beneficiary change, the email should change too and i should get the new value in my email field.
My first step is to returned the email field that contains the email but nothing is returned in my log :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var email1 = g_form.getValue('email');
var email2 = g_form.getValue('email_beneficiary');
console.log("Email1 = " + email1 + " - Email2 = " + email2);
//Type appropriate comment here, and begin script below
}
email1 return nothing but it should return the email of the beneficiary (the field is not empty, there is an email adress filled in).
email2 is the field where i want to copy the value of email1
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 03:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 03:08 PM
Hi Sonali,
The email1 field populate automatically on load form cause the beneficiary is the loggedin user before any change is made.
But nevermind, i found a way to achieve it.
in my onChange script, i made this change and selected the email1 field as the variable name :
g_form.setValue('email_beneficiary',newValue);
Regards,
