- 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-02-2022 06:25 AM
You want to do this on the form or on list?
- 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 01:51 AM
hi
Thank you for your reply i try it your code it works but i don't know why i got in the fields the sys_id of the assignment group i should get the name how can i fix that please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2022 02:07 AM
Did you use the Business rule?
if so then use this
current.<reference code field> = current.<application field>.<reference code field>.getDisplayValue();