Advanced Reference Qualifier Based-On Current Variable

codechaser
Giga Expert

Need help setting-up an advanced reference qualifier that uses the 'u_term_code' field from the *Term drop-down as a dependency and returns a list of courses that share the value.

javascript: u_term_code = current.variables.u_term_code;

Above, is the code I currently have.

Grade_Change_Form.png

47 REPLIES 47

Hi Harsh,



Yes, there is a common relationship in that they both share the field 'u_term_code'.   However, they are referencing different fields on their respective tables as display values.


above solutions should work..


are you doing it in your personal instance? if you want i can have look into this.


Hi Harsh!   I agree - the above SHOULD work.   There is something I'm missing, however when I set the Advanced reference qualifier, it returns no results.   Unfortunately, this is not my personal instance.   So, I am unable to share.


can you send me the screenshot of your table records?


or the value you are selecting on form and based on you are restricting the filter, just open the table and try to filter with those values and see if it's giving you the filter or not..


make sure in table the record did not contain extra space..


Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Lets take a step back.   I think we may have some relationship issues causing the issue.



I'd like for you to confirm a few things and to do that we need an onChange client script that will alert the values of your Term and Course variables.   I'd like for you run a quick test to invoke the alert message and then copy and paste the message from the alert into Notepad or your favorite text editor.   What I want you to confirm is if the Term value is a SysID and if that SysID is in a reference field within your course table.



  • Below is an example script.
  • If these variables are on a variable set then you will need to go to that variable set to create the catalog client
  • Create an onChange script on the Course variable
  • Then in your test fill in the Term and then choose a course and the alert message should appear

function onChange(control, oldValue, newValue, isLoading) {


      if (isLoading || newValue == '') {


              return;


      }


      var term = g_form.getValue("term_req");


     


      alert("Term: " + term + " Course: " + newValue);      


}