- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2018 06:55 AM
Hello! I want to get a question_choice (from the Multiple Choice) checked by the user on Catalog Item. I'm using Order Guide, so I have to pick this value from each card. I created a script on the Client side, that connect with the server using Ajax:
var ga = new GlideAjax('checkAttachments');
var cart = $j('#sysparm_cart_edit').val();
ga.addParam('sysparm_name', 'checknumber');
ga.addParam('sysparm_cart_id', cart);
ga.addParam('sysparm_attach_number', 1);
ga.getXMLWait();
Script on the Server Side below:
var cart = new GlideRecord('sc_cart_item');
cart.addQuery('sys_id', this.getParameter('sysparm_cart_id'));
cart.query();
while(cart.next()) {
var attachment = new GlideRecord('sys_attachment');
attachment.addQuery('table_name', 'sc_cart_item');
attachment.addQuery('table_sys_id', cart.sys_id.toString());
attachment.query();
var value = cart.variables.AAA;
By this end value I'm getting the question choice pinned to the multiple choice called AAA - but I would like to get the value the user has selected. Do you have any ideas how to solve this issue?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2018 07:08 AM
If you want to get the variable value set by user :
script include : current.variables.yourvariablename
catalog client script : g_form.getValue('yourvariablename')
Please do mark this answer helpful/correct if it answered your question.
Regards,
Swathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2018 07:08 AM
If you want to get the variable value set by user :
script include : current.variables.yourvariablename
catalog client script : g_form.getValue('yourvariablename')
Please do mark this answer helpful/correct if it answered your question.
Regards,
Swathi