Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

invite supplier contact in supplier lifecycle management is not working

jonathandrury
Tera Expert

We are trying to work through a supplier lifecycle proof of concept with our supplier manager in a PDI.

 

running glide-vancouver-07-06-2023__patch9-05-02-2024

 

When we get to the invite supplier contact step in the playbook the action errors. The script that is failing is below. It appears that supplierCommonUtil.requestNewSupplierContact(userFieldValues); is not returning a contact request. The Error is "Error: Cannot read property "sys_id" from null,Detail: Cannot read property "sys_id" from null"

 

(
function execute(inputs, outputs) {

var userFieldValues = {
first_name: inputs.first_name,
last_name: inputs.last_name,
title: inputs.title,
email: inputs.email,
supplier: inputs.supplier,
is_primary_contact: true
};

var supplierCommonUtil = new sn_slm.SupplierCommonUtil();
var newContactRequest = supplierCommonUtil.requestNewSupplierContact(userFieldValues);

outputs.case_sys_id = newContactRequest.sys_id;

})(inputs, outputs);

 

This can further be reproduced by running this background script. 

 

Run this script (with a valid supplier id)

var userFieldValues = {
first_name: 'first',
last_name: 'last',
title: 'cio',
email: 'example@example.com',
supplier: 'a93c42bb83c1121040f561e0deaad3e2',
is_primary_contact: true
};

var supplierCommonUtil = new sn_slm.SupplierCommonUtil();

var newContactRequest = supplierCommonUtil.requestNewSupplierContact(userFieldValues);

var case_sys_id = newContactRequest.sys_id;

1 REPLY 1

Priscilla Muiua
ServiceNow Employee
ServiceNow Employee

Hello @jonathandrury 

 

This question can be best answered by the Supplier Lifecycle Management team in the Source-To-Pay product community site. Please ask your question on their forum here: https://www.servicenow.com/community/source-to-pay-operations/ct-p/source-2-pay-operations

 

Thank you.