Getting Value of a field in Record Producer form

Sergio Gadelha
Tera Contributor

Hi, I've a Reference field and I want to use dynamic reference qualifier in him. So I've to create a Dynamic Filter Option, and a Script include that return a string query.

My problem is I can't get the value of a field in record producer called "u_hotel_spirit_code". That field is Reference too.

current.u_hotel_spirit_code --> Don't work

producer.u_hotel_spirit_code --> Don't work

g_form.getValue('u_hotel_spirit_code') --> Don't work

Someone could help me?

Script Include:
scriptInclude.jpg

Dynamic Filter:

dynamicFilter.jpg

The second must be filtered by the first:

relationalThings.jpg

1 ACCEPTED SOLUTION

Sergio Gadelha
Tera Contributor

I found here the answer: https://community.servicenow.com/message/760842#760842




To access the variables on server-side, you've to use "current.variables.variableName".




In my case: "current.variables.u_hotel_spirit_code".




My Dynamic Filter Option now:
dynamicFilter.jpg






My Script Include now:



scriptInclude.jpg


View solution in original post

16 REPLIES 16

Sergio Gadelha
Tera Contributor

I found here the answer: https://community.servicenow.com/message/760842#760842




To access the variables on server-side, you've to use "current.variables.variableName".




In my case: "current.variables.u_hotel_spirit_code".




My Dynamic Filter Option now:
dynamicFilter.jpg






My Script Include now:



scriptInclude.jpg