- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2020 01:20 AM
I have created a form in that I have added few fields in that I have created "Account" , "Display Name" & "Name" Fields.
In this I need help whenever I request new project I will select "Account" field and fill " Name" Fields. So, here I need to automatically "Display Name" filed has to fill Example : " Account - Name" fields values in Display Name filed.
Please help the field values has to be in this sequence in Display Name Filed : " Account - Name"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2020 03:46 AM
try this code :
is backed name of name field "short_description" ??
is yes then :
var account= g_form.getReference("u_account").short_description;
var name= g_form.getValue("short_description");
var displayName = account +"-"+name;
g_form.setValue("u_display_name",displayName);
=====================================
but if backend name of "name" field is another then:
var account= g_form.getReference("u_account").short_description;
var name= g_form.getValue("backend name of name field");
var displayName = account +"-"+name;
g_form.setValue("u_display_name",displayName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2020 02:16 AM
Onchange or on submit script must be written as per the requirement most preferrably onsubmit
var name=g_form.getValue('database value of name');
var account=g_form.getDisplayValue('databasevalueof account'); // this line of code works on Service Portal
or
var account = getDisplayBox('databasevalue of account').value; // this line works in it view
var dn=account+"-"+name
// alert(dn);
g_form.setValue('database value of display name',dn);