Access to text value vs listId of selected listView

Posted by ceteris on 17-Jul-2015 12:18

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

Posted by ceteris on 21-Jul-2015 07:19

Gian:

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

John

All Replies

Posted by Gian Torralba on 21-Jul-2015 06:51

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

Posted by ceteris on 21-Jul-2015 07:19

Gian:

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

John

This thread is closed