Notifications

15 views

Description

Symptoms

When use script to order record producers with multi-row variable sets, the generated record has unexpected variables displayed in the variable editor in random order.

Steps to reproduce:

1. Create a multi-row variable set with a few variables in it. 

2. Make sure the record producer table has variable editor configured as per the following DOC: 
https://docs.servicenow.com/bundle/madrid-it-service-management/page/product/service-catalog-management/task/configure-default-variable-editor.html 

3.  "Try it" the Record Producer in service catalog.

(Leave the multi-row variables blank.) 

4. Review the submitted incident, the variable display is all correct. 

5. Now, run the followin script to order the record producer. 

var cartOne = new sn_sc.CartJS(); 

var requestInc = 

'sysparm_id': '3f1dd0320a0a0b99000a53f7604a2ef9', 

'variables':{ 

'urgency': '1', 

'comments': 'SNC test INT', 

}; 

var cartDetailsOne = cartOne.orderNow(requestInc); 

6. Review the submitted incident, the variable display is unexpected. 

Release

Madrid

Cause

This is due to using the wrong API for a record producer.

Resolution

Use below API instead:

 

var record = new sn_sc.CatItem('3f1dd0320a0a0b99000a53f7604a2ef9'); 
var requestInc = 

'sysparm_id': '3f1dd0320a0a0b99000a53f7604a2ef9', 
'variables':{ 
'urgency': '1', 
'comments': 'SNC test INT', 

}; 
var recordDetails = record.submitProducer(requestInc);

Article Information

Last Updated:2019-08-20 22:01:52
Published:2019-08-21