Highlighted
Super Contributor.
Super Contributor.
138 views

Find the full name from the Contact record if it is filled in from the "userPrincipalName" field

Jump to solution

In my integration v9.50 + Connect it 9.80 Contact name = Operator name and not equal to their username in LDAP.
Instead, the Contact and Operator are called the "userPrincipalName" field from the LDAP field of the user card.
This is done in order to avoid the conflict of identical usernames. A company has a large staff of employees, sometimes the names are completely the same, but they are different people.
"userPrincipalName" is always unique in our domain. Therefore, I divided the users according to this field.
But there was a problem with the real username, which needs to be specified in the registration messages "Interactions" when creating via SmartEmail.
The full username is filled only in the "Full Name" in the "Contact" record of the user.

I solve this problem with the function in the SmartEmailSecurityUtils library:

/**
*   get fullname info by contact name
*
*   @param {contactName} - contact name(userPrincipalName)
*   @return - contact full name
**/

function findContactName( contactName ){
 var contact=new SCFile("contacts", SCFILE_READONLY);
    var rc=contact.doSelect("contact.name=\""+contactName+"\"");
    if (rc == RC_SUCCESS) {
    var fullname = contact['full.name'];
    	return fullname;
    } else {
    	return null;
    }
    return null;
}

Also, add variables to the HTML-template:

//#################################################################################################################

//for the .assigne template $RECORD.contact_fullname = lib.SmartEmailSecurityUtils.findContactName($RECORD.contact_name);
//for the .fulfilled template assinee_fullname = lib.SmartEmailSecurityUtils.findContactName($RECORD.assignee_name);
//#################################################################################################################

Of course, this is not the most beautiful decision, but it helped me.
Hope to help someone else.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Honored Contributor.
Honored Contributor.

Re: Find the full name from the Contact record if it is filled in from the "userPrincipalName&q

Jump to solution

Hello

Hope you are doing well.

thanks for sharing this. it will be of great us for us in the future

BR!

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation.

View solution in original post

0 Likes
1 Reply
Highlighted
Honored Contributor.
Honored Contributor.

Re: Find the full name from the Contact record if it is filled in from the "userPrincipalName&q

Jump to solution

Hello

Hope you are doing well.

thanks for sharing this. it will be of great us for us in the future

BR!

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.