- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 01:31 PM
I created a single line text variable for called "application id" but the application id is also available if you hover over the reference icon. How can i take the application id that was selected and showing from the reference icon and populate it to the variable field on the form i created so the user doesn't have to hover over the reference field. When I create the variable as a reference...the table is not available to select, but a parent of that table is able to be selected. Seems like i can use some type of catalog client script or something to populate the info. See below when you hover or click the more information for the .Net Services and Console App, the Application ID is available, however the users want it to to be directly on the form and not have to hover. Please advise. Thanks!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 01:42 PM
Cenelle,
Have an onChange catalog client script on the reference variable 'What is the Business Application ID?'. and using the getReference() method you can get the application id and populate the same in the single line text variable you have created.
Code inside the onChange script:
var application = g_form.getReference('<reference_variable_name>',populateAppID);
function populateAppID(application) {
g_form.setValue('<text_variable_name>',application.<field_name_that_holds_application_id_in_the_record>);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 01:42 PM
Cenelle,
Have an onChange catalog client script on the reference variable 'What is the Business Application ID?'. and using the getReference() method you can get the application id and populate the same in the single line text variable you have created.
Code inside the onChange script:
var application = g_form.getReference('<reference_variable_name>',populateAppID);
function populateAppID(application) {
g_form.setValue('<text_variable_name>',application.<field_name_that_holds_application_id_in_the_record>);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 01:57 PM
Yes Perfect! Thank you Guhan! I will try this out!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 01:59 PM
Sure. Do let me know if any doubts. Please mark the thread as helpful/answered if it was helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2015 02:24 PM
So the script is working its just saying [object Object] instead of the app id. I have left something out///
My script is :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var application = g_form.getReference('v_business_app_id',populateAppID);
function populateAppID(application) {
g_form.setValue('v_app_id_number',application);
}
//Type appropriate comment here, and begin script below
}
Please advise