cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Experts,

I have a weird issue I'm hoping you can help me with. I'm trying to find out why a value that I'm trying to set with uIS_SetValue is showing an error in the attribute value instead of what I'm feeding into the function. Here's the script in question, see line 26 (I have marked it):

// Main function: z_setDN


function z_setDN(Par){ 
	var split = Par.split("||");
	var adLogin = split[0];
	var startPoint = split[1];
	var mskey = split[2];
	var prefix = Left(adLogin,3);
	var IDStoreID = uGetIDStore();
	var country = "";
	var city = "";
	var entity = "";
	var finalResult = "";
	var sql = "";
	var uISResult = "";
	
	if(prefix == "ADM" || prefix == "ADS" || prefix == "CYB" || prefix == "EXU") {
		uISResult = uIS_SetValue(mskey, IDStoreID, "Z_MX_AD_" + prefix + "_LOGIN_ID", adLogin);
		if(prefix == "EXU") {
			finalResult = "cn=" + adLogin + "," + startPoint;
		} else {
			finalResult = "cn=" + adLogin + ",ou=Users," + startPoint;
		}
		uWarning("finalResult (pre-set of Account_DN_AD>: " + finalResult);
Line26:		uISResult = uIS_SetValue(mskey, IDStoreID, "Z_MX_ACCOUNT_DN_AD_" + prefix, finalResult);
		uWarning("uISResult: " + uISResult);
	} else {
		uISResult = uIS_SetValue(mskey, IDStoreID, "Z_MX_AD_INTERNAL1_LOGIN_ID", adLogin);
		sql = "select SEARCHVALUE from IDMV_VALUE_BASIC \
				where ATTRNAME = 'Z_MX_AD_TRIGRAM' and MSKEY in ( \
				select MCSEARCHVALUE as MSKEY from IDMV_VALLINK_BASIC \
				where MSKEY = " + mskey + " and MCATTRNAME = 'MXREF_Z_MX_OFFICE_LOCATION_MAPPING')";
		city = uSelect(sql);
		sql = "select SEARCHVALUE from IDMV_VALUE_BASIC \
				where ATTRNAME = 'Z_MX_COUNTRY' and MSKEY in ( \
				select MCSEARCHVALUE as MSKEY from IDMV_VALLINK_BASIC \
				where MSKEY = " + mskey + " and MCATTRNAME = 'MXREF_Z_MX_OFFICE_LOCATION_MAPPING')";
		country = uSelect(sql);
		sql = "select SEARCHVALUE from IDMV_VALUE_BASIC \
				where ATTRNAME = 'Z_MX_LEGAL_ENTITY_AD' and MSKEY in ( \
				select MCSEARCHVALUE as MSKEY from IDMV_VALLINK_BASIC \
				where MSKEY = " + mskey + " and MCATTRNAME = 'MXREF_Z_MX_LEGAL_ENTITY_MAPPING')";
		entity = uSelect(sql);
		finalResult = "cn=" + adLogin + ",ou=USERS,ou=" + entity + ",ou=" + city + ",ou=" + country + "," + startPoint;
		uISResult = uIS_SetValue(mskey, IDStoreID, "Z_MX_ACCOUNT_DN_AD_INTERNAL1", finalResult);
	}


	uWarning("finalResult: " + finalResult);
	// uSetContextVar("Z_NEW_ACCTDN", finalResult);
	// uSetContextVar("Z_NEW_LOGIN_ID", adLogin);	
	// uSetContextVar("Z_USR_MSKEY", mskey);
	return finalResult;
}

Also, here's the screen shot with the values of the uWarning messages from lines 25 and 27:

As you can see, the value of, "finalResult" is a valid AD DN and the uIS_SetValue result is a, "+", meaning that it executed properly. However, here's the value of the attribute when I query the database:

Why is there an error in there? Everything is configured properly. This makes no sense. Has anyone seen this before?

0 Likes
View Entire Topic
Steffi_Warnecke
Active Contributor
0 Likes

Hello Brandon,

just some brainstorming:

  • Is there any validation on that attribute?
  • Do you have an example sql query result where the DN attribute is filled with a correct value? Not Marty, maybe the Doc is somewhere to be found? 😉

.

Regards,

Steffi.