Access to text value vs listId of selected listView - Forum - Rollbase - Progress Community

Access to text value vs listId of selected listView

 Forum

Access to text value vs listId of selected listView

This question is answered

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

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:

  • Timing: After Update
  • On Field Change: View ID
  • Trail Template: View ID {!View_ID} has been accessed.

This should generate an audit trail containing the View ID everytime the view is changed.

- See more at: https://community.progress.com/community_groups/rollbase/f/25/t/19153.aspx#sthash.HYryUsw6.dpuf

Verified Answer
  • Gian:

    Excellent!  Works perfectly. Thanks for the quick solution. I appreciate it.

    John

All Replies
  • Hello,

    Can you try using JQuery to achieve this?

    <script>
    $(function(){
        previousOnchange = $("select:eq(0)").attr("onchange");
        $("select:eq(0)").change(function(){
            //get text value of selected option
            var t =$(this).find('option:selected').text();

            //set field using rbf method
            rbf_setField('USER', {!#CURR_USER.id}, 'View_ID', t, false);
        });
    });
    </script>


    Thank you,

    Gian

  • Gian:

    Excellent!  Works perfectly. Thanks for the quick solution. I appreciate it.

    John