- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 08:46 AM
Hi,
I have created a catalog with nested categories. Inside categories there are different catalog items.
An example: Pen & Pencil > Pen > Blue pen
Blue pen is my catalog item and inside the form there are these fields:
Category: Pen & Pencil
Sub category: Pen
Item: Blue Pen
How can i autoppulate these fields by mean of a catalog client applied to a set of variables?
The idea is that it is autopopulate for any catalog item that i select.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 11:15 AM - edited 05-15-2023 11:17 AM
Hi @Matteo M ,
I recreated your example and used an onLoad Client script and a script Include to achieve the above scenario. Please find the below code Snippets:-
Client Script:-
Code Snippet:-
Code Snippet:-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 11:15 AM - edited 05-15-2023 11:17 AM
Hi @Matteo M ,
I recreated your example and used an onLoad Client script and a script Include to achieve the above scenario. Please find the below code Snippets:-
Client Script:-
Code Snippet:-
Code Snippet:-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 01:24 AM
Hi @Mallidi Suma ,
First of all thank you for the support!
I have a few questions more:
I should just change the sysparm ID and the strings inside getsetvalue, am i right?
Where can i take the syparm id of the catalog? I tried but it is not working and im sure that it is my fault.
If i should add a sub sub category, how should i modify the code?
Thank you in advance for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 01:44 AM
Hi @Matteo M ,
Please find the answers below,
1. I should just change the sysparm ID and the strings inside getsetvalue, am i right?
A:- No need of changing anything in this line
"var cat_item_sysID = g_form.getParameter('sysparm_id');". // This line will automatically fetch the sys_id of your catalog item from the URL.
2. Where can I take the syparm id of the catalog?
A:- No change needed.
3. If i should add a sub-sub category, how should I modify the code?
We need to send the sub-sub category of the catalog item to the Script Include, and we need to dot walk to its
subcategory and category. Let me know if you need help with this code.
Please mark my answers as helpful.
Thanks & Regards,
Suma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 05:15 AM
Still not working.
I modified this part as follow, due to different name of variable:
About the second script "cliencallableajax", i wrote it inside system Ui > script includes; is it correct?