- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 06:18 AM
Hi,
i have two fields the first is a reference on a table , i should once the user select the name in the field Application (1) the second field Refernence cde (2) will be filled automatically by assignment group concerning the name
this the table :
once user select in the field application "name" the filed reference cde should be fill with the assignment group of this name("test");
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 06:29 AM
On the form you can do it like below
Add an oncchange client script that runs on change of Application field
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var ref = g_form.getReference('<application field name>', getAppl);
}
function getAppl(ref) {
g_form.setValue('<Reference code field name>', ref.<name of field on referenced table>);
}
}
If you want to do it on the list then you have to create a Business Rule.
Condition: <reference code field > is empty
AND
Application changes
Before
Update
Script:
current.<reference code field> = current.<application field>.<reference code field>;
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 02:14 AM
hi
i didn't use business rule i use a client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ref = g_form.getReference('u_application_bte', getAppl);
}
function getAppl(ref) {
g_form.setValue('u_groupe_d_affectation_bte', ref.u_groupe_d_affectation_bte);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 02:19 AM
Hi,
Try this
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ref = g_form.getReference('u_application_bte', getAppl);
}
function getAppl(ref) {
g_form.setValue('u_groupe_d_affectation_bte', ref.u_groupe_d_affectation_bte.<name or the display field name>);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 02:28 AM
hi
i don' undertsand this "name or the displayed field name" should i put the name of the asssignment group like this : don't work i get undefined
g_form.setValue('u_groupe_d_affectation_bte', ref.u_groupe_d_affectation_bte.u_groupe_d_affectation_bte);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 03:07 AM
You are getting the sys if as that field is also a reference field, so im asking to dot walk to that table and pick the title field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 05:28 AM
the name of the field Application is u_application_bte and is a refernce of this table
the name of the field Refernce Cde is u_groupe_d_affectation_bte
the name of the assignment group in the table is u_assignment_group_b
this is the code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ref = g_form.getReference('u_application_bte', getAppl);
}
function getAppl(ref) {
g_form.setValue('u_groupe_d_affectation_bte', ref.u_assignement_group_b);
}