Record Producer Variable & Varaible Set

UKush
Tera Contributor

Hi,

I have a requirement in my Record Producer where there is a variable named 'From Stockroom' and a Variable Set containing the following fields:

1. Model - Reference to Model table 

2. Condition - Select box - (New/Used/Refurbished)

3. Available Quantity - Read only , single line text.


Requirement 

I want to auto-populate the 'Available Quantity' (quantity field sum) from alm_asset table based on the selected from_stockroom, model and condition. 

For this requirement I have created a Client Callable Script Include and Onchange Client Script on condition field.

Using this setup, I am able to retrieve the correct quantity (sum) based on model and condition. However when I add from_stockroom to the query, the value is coming as a null, even though the stockroom is selected on the Record producer.

Note - Condition field is available in alm_asset table. And Onchange Client Script is written on condition field in record producer variable set.

1 ACCEPTED SOLUTION

Chaitanya ILCR
Giga Patron

Hi @UKush ,

 

is the variable set you are referring to is a MVRS?

 

if yes 

 

you have to use 

g_service_catalog API 

https://www.servicenow.com/docs/r/api-reference/g_service_catalogClientAPI.html

 

g_service_catalog.parent.getValue("add your from_stockroom variable name here")//is it from_stockroom?

if you are still facing the issue please share the more details like scripts and the variable information with some screenshots 

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

View solution in original post

1 REPLY 1

Chaitanya ILCR
Giga Patron

Hi @UKush ,

 

is the variable set you are referring to is a MVRS?

 

if yes 

 

you have to use 

g_service_catalog API 

https://www.servicenow.com/docs/r/api-reference/g_service_catalogClientAPI.html

 

g_service_catalog.parent.getValue("add your from_stockroom variable name here")//is it from_stockroom?

if you are still facing the issue please share the more details like scripts and the variable information with some screenshots 

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya