cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Can I get the button that triggered a service in the script of that service?

nadams1
10-Marble

Can I get the button that triggered a service in the script of that service?

I have a script that returns an infotable of dates (to drive a report). I want to provide three buttons to trigger different results from this script. for yesterday, last week and last 30 days.

The script works by setting the end date to yesterday and the start date to yesterday -0, -7 or -30 doys.

What I want to do is assiocate the number with each of the buttons, which when clicked will trigger the script but the value 0, 7, 30 would be avilable in the script.

I've tried setting the number in the buttons contextid but can't see a way to pass this into the script as I can only bind one button to the input parameter. I have also tried binding the button to another script which sets a session parameter (programmatically) but this requires a browser refresh to update the session parameter so it not practical.

is there anyway to get the button that triggered a service?

ACCEPTED SOLUTION

Accepted Solutions

You can do it in different ways:

  • You can use a Radio Button which has 3 states ( one for each value )
  • You can use a DropDown list with the 3 values with three good looking names, and selected row has a value ( not shown field ) which it's the number of days, and this selected row it's the one you pass as the parameter on the service.
  • Trying to do it with Buttons will be hard, you will need too much controls to do it ( Checkboxes and Expression widgets ).

View solution in original post

2 REPLIES 2

You can do it in different ways:

  • You can use a Radio Button which has 3 states ( one for each value )
  • You can use a DropDown list with the 3 values with three good looking names, and selected row has a value ( not shown field ) which it's the number of days, and this selected row it's the one you pass as the parameter on the service.
  • Trying to do it with Buttons will be hard, you will need too much controls to do it ( Checkboxes and Expression widgets ).

Thank you - never even thought of using radio buttons/list. I've opted for dropdown,

Announcements


Top Tags