Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Setting a script to run on UI Page

Not applicable

I am working on a UI Page that has two input fields for Fiscal Year and Quarter. From those values, I need to run a script to create child records to a table for a data call. I don't know how to get the call to initiate after the user enters the values and clicks OK. After clicking OK, I want to take the values from the UI Page and either run a script to process the datacall or call a business rule to do the same. Is this possible?

2 REPLIES 2

Joshua_Quinn
Kilo Guru

If your UI Page is on a Service Catalog, you will need a Catalog Client Script set to onChange of the field and then pass that data into a GlideAjax script include that can do the data calls you need.

If the UI Page is on the Now User Access Interface, then this can be accomplished with a similar Client Script on the form.

KristenA1641094
Kilo Sage
  • In the input fields, include an id: 

 

<input id="service_input" class="select2 form-control"/>

 

  • Then for your button, you'll call a client script:

 

<button id="ok" class="btn btn-primary" onclick="return submitOk(); ">

 

  • Then in the client script you can get that input variable:

 

var selServe = $j("#selected_service").val($j("#service_input").select2('val'))

 

  • Then in the processing script, you can use selServe (or your vars) to do your server side logic.