The CreatorCon Call for Content is officially open! Get started here.

Query table data to display in a Service Catalog field

L_10
Kilo Contributor

Hi Community,

I have a question about Service Catalog variables.

 

<field A> A user selects an item name (in the image below, the variable name is "u_item_name_men")

<field B> A user selects whether or not s/he wants the item new or second hand ("u_item_newreuse_men")

             (this is not yet described in the code below, just wanting to add in the future)

<field C> Unit price of A item depending on A&B's selection ("u_item_unitprice_men")

A, B, and C are in the same variable set "u_vset_men".

The table I want the data to reference is "u_uniform_item_master".

The Catalog Client Script is like the image below:

find_real_file.png

As the result, nothing is displayed...

What part do i write wrong?? Could anyone give me some tips??

Thanks in advance.

Lit

19 REPLIES 19

Hi,

Create a new script include and place only your function code in it.

It will look like this.

find_real_file.png

Hi Priya,

thank you for your reply.

 

Now it says "4019" instead of null, soon after I select an item.

find_real_file.png

Could it possibly due to settings of this environment?? 

Seems like there are a lot of weird behavior in Japanese environment.

 

Cheers,

Lit

Can you please check if there is any alert placed in your client script or any other on change client script is available for the item name field?

Hi Priya,

it turned out that the number in the popup is the unit price.

When I clicked [OK], the unit price field is filled.

 

And I could not find any other alerts regarding client script or client script.

(maybe wrong place to search... I'm too new to this 😞

 

Cheers,

Lit

abhinavnishant
Tera Contributor

What I understand of the problem/requirement is there are three dropdowns named A, B and C.

B's value depends on the selection of A and C's value depends on the selection of B.

The entire data combination is in a table X.

While this is a good way to do this, I will recommend to use either "Reference Qualifiers"  or "Dependent Values" for these kind of related Drop Downs.

With this there will be no coding required which will eventually render the page and results faster making it more efficient.

Let me know if any help is needed regarding this.

 

-Best

Abhinav