Auto populate short description based off category and subcategory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2020 10:03 PM
Hi Community,
I have requirement to auto populate the short description based off category and sub-category (service catalog). Based on category i'm populating sub-category using on change client script. Here the requirement is based on category and sub-category values i need to populate the short description value. I have 10 category and almost 20 sub-category and each sub-category has more the 25 short description. If i hard code the code like add option and remove option the code is near to 5k length.
Can some one help me how to achieve this.
Thanks in advance
Rafmine
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2020 10:14 PM
Hi Rafmine,
Please refer the link below as it has kind of similar requirement as yours-
Warm Regards,
Shubham Bongulwar
Please mark helpful or correct if it helps!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2020 10:25 PM
Hi Rafmine
if the short description must be set as category + sub_category than the other reply works..but in case you have a list of descriptions and you need to pick one specific according to category and sub category then I'm sorry to say that hardcoding is not the right option.
Not sure the situation with custom tables within your organisation/contract but this sounds achievable with a custom table where you can store all the short descriptions.
Of course, the new table must keep category (ref to sys_choice) subcategory (ref to sys_choice and dependent to category) and short description and used as matrix to get the right short-description.
If you have the table, you can use onChange code - unfortunately - async Ajax to retrieve the right description.
This will reduce the amount of code but will include the maintenance of the new table where you have the short descriptions handled
Cheers
R0b0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2020 11:54 PM
Hi Robo,
Thank you for showing interest in answering my post.
we don't have permission to create custom table. the three variable are select box type and the values is stored in question_choice table.
can you help me with the async ajax code to complete my task.
Thanks,
Rafmine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2020 12:15 AM
Hi Rafmine
if you are working on another sys_choice then you don't need to write any code.
Try making the short description field dependent to the actual sub category field that you have..something like this on your dictionary.
Then You can work on the dependent field column available on sys_choice table to match the actual value of sub category you want
This should work..of course the user is in charge to pick from the drop down list.
Cheers
R0b0