You can use the following code to accomplish this requirement:
$(function() { previousOnchange = $("select:eq(0)").attr("onchange"); $("select:eq(0)").attr("onchange", "rbf_setField('USER', {!#CURR_USER.id}, 'View_ID', this.value, false);"+previousOnchange); });
First, you need to create a Text field with the integration name View_ID in USER object. Then, create a Create Audit Trail Record trigger with the following properties:
This should generate an audit trail containing the View ID everytime the view is changed.
Thanks for the quick response. I'm creating an audit trail of User activities (e.g., pages visited, files opened, etc.). Using the listView page onload trigger produces only a generic "(User Name) opened Applications List View Page" audit trail record. My goal it to specify in the audit trail record which specific listView was chosen. Your function works perfectly for displaying the selected listView. How can I pass this listView ID on to the audit trail trigger?
Thanks again
Using the code below, you can prepend a code to the onchange event of list view.
$(function() { var previousOnchange = $("select:eq(0)").attr("onchange"); $("select:eq(0)").attr("onchange", "alert(this.value);"+ previousOnchange); });
What is your objective in adding a function to the onchange event of a list view?
Thanks Godfrey for the quick turnaround and flawless solution!!
John
Using the code below, you can prepend a code to the onchange event of list view.
$(function() { var previousOnchange = $("select:eq(0)").attr("onchange"); $("select:eq(0)").attr("onchange", "alert(this.value);"+ previousOnchange); });
What is your objective in adding a function to the onchange event of a list view?
Thanks for the quick response. I'm creating an audit trail of User activities (e.g., pages visited, files opened, etc.). Using the listView page onload trigger produces only a generic "(User Name) opened Applications List View Page" audit trail record. My goal it to specify in the audit trail record which specific listView was chosen. Your function works perfectly for displaying the selected listView. How can I pass this listView ID on to the audit trail trigger?
Thanks again
You can use the following code to accomplish this requirement:
$(function() { previousOnchange = $("select:eq(0)").attr("onchange"); $("select:eq(0)").attr("onchange", "rbf_setField('USER', {!#CURR_USER.id}, 'View_ID', this.value, false);"+previousOnchange); });
First, you need to create a Text field with the integration name View_ID in USER object. Then, create a Create Audit Trail Record trigger with the following properties:
This should generate an audit trail containing the View ID everytime the view is changed.
Thanks Godfrey for the quick turnaround and flawless solution!!
John
Godfrey:
How would I alter your code to use the text value (i.e., "All Applications") instead of the listId (i.e., 6839800) in the audit trail?
Thanks,
John
[quote user="Godfrey Sorita"]
You can use the following code to accomplish this requirement:
1
2
3
4
|
$( function () { previousOnchange = $( "select:eq(0)" ). attr ( "onchange" ); $( "select:eq(0)" ). attr ( "onchange" , "rbf_setField('USER', {!#CURR_USER.id}, 'View_ID', this.value, false);" +previousOnchange); }); |
First, you need to create a Text field with the integration name View_ID in USER object. Then, create a Create Audit Trail Record trigger with the following properties:
This should generate an audit trail containing the View ID everytime the view is changed.