<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
I submitted a question a week or so ago and I still cannot solve my
problem.<br>
<br>
Please know I have searched the wiki quite a bit and have tried
several adaptations of different scenarios to try and achieve my
goal.<br>
<br>
I would like to have a custom field which is set at Transaction time
to the Requestors Initial of the Last Name. <br>
<br>
I have tried using<span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: 'Times New Roman'; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px; font-size:
medium;"><br>
<br>
</span><span class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: 'Times New Roman';
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; font-size: medium;">
<div style="margin: 0px; background-color: transparent;"><span
id="internal-source-marker_0.4656425404828042"
style="font-size: 11pt; font-family: Arial; color: rgb(0, 0,
0); background-color: transparent; font-weight: normal;
font-style: normal; text-decoration: none; vertical-align:
baseline; white-space: pre-wrap;">my $RequestorRealName =
$self->TicketObj->CreatorObj->RealName;</span></div>
</span><span class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: 'Times New Roman';
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; font-size: medium;">
<div style="margin: 0px; background-color: transparent;"><span
id="internal-source-marker_0.4656425404828042"
style="font-size: 11pt; font-family: Arial; color: rgb(0, 0,
0); background-color: transparent; font-weight: normal;
font-style: normal; text-decoration: none; vertical-align:
baseline; white-space: pre-wrap;">my $RequestorRealName =
$Ticket->Requestors->UserMembersObj->First->RealName;<br>
<br>
</span><span class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: 'Times New Roman';
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; font-size: medium;">
<div style="margin: 0px; background-color: transparent;"><span
id="internal-source-marker_0.4656425404828042"
style="font-size: 11pt; font-family: Arial; color: rgb(0,
0, 0); background-color: transparent; font-weight: normal;
font-style: normal; text-decoration: none; vertical-align:
baseline; white-space: pre-wrap;"># Split the name into an
array</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent; font-weight:
normal; font-style: normal; text-decoration: none;
vertical-align: baseline; white-space: pre-wrap;">my
@nameArray = split(/\s+/, $RequestorRealName);</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent; font-weight:
normal; font-style: normal; text-decoration: none;
vertical-align: baseline; white-space: pre-wrap;"></span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent; font-weight:
normal; font-style: normal; text-decoration: none;
vertical-align: baseline; white-space: pre-wrap;">#
Extract the first letter of the last element of the array</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent; font-weight:
normal; font-style: normal; text-decoration: none;
vertical-align: baseline; white-space: pre-wrap;">my
$LastInitial = substr(pop(@nameArray), 0, 1);<br>
<br>
I cannot even get the CF value to become the whole name
which makes me think I am not using the correct obj name??<br>
<br>
At the risk of being a pain I am resubmitting.<br>
<br>
Please tolerate my persistence and I will not post again<br>
<br>
Thanks<br>
<br>
Joe<br>
<br>
PS: Here is the code I am using to set the value which I
had gotten a while back for another situation and it works
fine in my other situation.<br>
<br>
</span><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: 'Times New Roman'; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; font-size: medium;">
<div style="margin: 0px; background-color: transparent;"><span
id="internal-source-marker_0.4656425404828042"
style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;">unless(
$self->TicketObj->FirstCustomFieldValue(
$CFObj->id ) ) {</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;"> my( $st, $msg ) =
$self->TicketObj->AddCustomFieldValue(</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;">
Field =>
$CFObj->id,</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;">
Value =>
$RequestorRealName,</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;">
RecordTransaction
=> $RecTransaction );</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;"> unless( $st ) {</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;"> $RT::Logger->warning(
"Couldn't set $DefaultValue as value for CF $CFName:".
$msg );</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;"> return undef;</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;"> }</span><br>
<span style="font-size: 11pt; font-family: Arial; color:
rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal;
text-decoration: none; vertical-align: baseline;
white-space: pre-wrap;"> }</span></div>
</span><span style="font-size: 11pt; font-family: Arial;
color: rgb(0, 0, 0); background-color: transparent;
font-weight: normal; font-style: normal; text-decoration:
none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
</span><br>
</div>
</span>
<pre class="moz-signature" cols="72">--
Joe Kirby , Assistant Vice President, Business Systems
Division of Information Technology (DoIT)
Support Response - <a class="moz-txt-link-freetext" href="http://www.umbc.edu/oit">http://www.umbc.edu/oit</a>
Administration 627
Office - 410-455-3020
Email - <a class="moz-txt-link-abbreviated" href="mailto:kirby@umbc.edu">kirby@umbc.edu</a></pre>
</body>
</html>