- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 07:11 AM
I have a script that sets the value from another field on the form but it seems to be adding extra characters to the end.
The client script is read the Parent Agreement number and setting it in the field information:
The highlighted field should be showing the exact value from the Parent Agreement field but it adds -J001.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 10:39 AM
Hello @polodre2
Please give a try to the script below and see how it works for you.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var choiceoption = g_form.getValue('u_art_4_2_1_dp1_fin_obl');
var getNameValue = g_form.getDisplayValue('u_parent_agreement');
if (choiceoption == 'No Cost Option') {
var message = 'ARL CRADA + (' + getNameValue + ') Article 5.2.1, "No Cost Option" has been chosen for technical efforts under this JWS';
g_form.showFieldMsg('u_art_4_2_1_dp1_fin_obl', message, 'info');
g_form.addInfoMessage(message);
} else if (choiceoption == 'Payment to ARL Option') {
var message = 'ARL CRADA + (' + getNameValue + ') Article 5.2.2, "Payment to ARL Option" has been chosen for technical efforts under this JWS';
g_form.showFieldMsg('u_art_4_2_1_dp1_fin_obl', message, 'info');
g_form.addInfoMessage(message);
}
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:39 AM
Hello @polodre2
Please check if any default value is assigned for parent or assigning field.
Thanks
Jagadish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 10:39 AM
Hello @polodre2
Please give a try to the script below and see how it works for you.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var choiceoption = g_form.getValue('u_art_4_2_1_dp1_fin_obl');
var getNameValue = g_form.getDisplayValue('u_parent_agreement');
if (choiceoption == 'No Cost Option') {
var message = 'ARL CRADA + (' + getNameValue + ') Article 5.2.1, "No Cost Option" has been chosen for technical efforts under this JWS';
g_form.showFieldMsg('u_art_4_2_1_dp1_fin_obl', message, 'info');
g_form.addInfoMessage(message);
} else if (choiceoption == 'Payment to ARL Option') {
var message = 'ARL CRADA + (' + getNameValue + ') Article 5.2.2, "Payment to ARL Option" has been chosen for technical efforts under this JWS';
g_form.showFieldMsg('u_art_4_2_1_dp1_fin_obl', message, 'info');
g_form.addInfoMessage(message);
}
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 01:07 PM
Debug using:
alert('choiceoption = ' + choiceoption + ', getNameValue = ' + getNameValue);
just after the two lines that set those values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 10:51 AM
Hi @polodre2 ,
1) Please check the script that populates the Parent Agreement Value,
2) Also check the value, since in one of the replies you mentioned that it is a reference field, but there might be the table where the actual data of Parent Agreement Value is stored.
Rest your code looks good, first lets verify these things and proceed further to solve your problem, if it haven't solved yet.