I'm trying to append a couple fields to the subject line in SD+. The code I've got is:
//get first + last name and append to subject to include full name
if($CS.isFormSubmit()){
var firstName = await CS.getValue("UDF_FIELDS.UDF_CHAR2"); //new hire first name
var lastNameName = await CS.getValue("UDF_FIELDS.UDF_CHAR3"); //new hire last name
var subject = await CS.getValue("SUBJECT"); //subject
var newSubject = subject + ": " + firstName + " " + lastName; // changes subject to subject + new hire full name
CS.setValue("SUBJECT", newSubject); //set subject line to include subject and full name
}
This however, does not seem to be working and I think it's because I'm not getting the correct name for the fields. The question I have is how would I go about finding the correct name of the field? I'm also a bit new to javascript and am not sure my script is 100% correct.
Thank you for any help!