<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 29 August 2013 13:31, Kevin Falcone <span dir="ltr"><<a href="mailto:falcone@bestpractical.com" target="_blank">falcone@bestpractical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">Because Custom Fields can hold a LONGBLOB worth of data.<br>
</div>
Go save a large text CF and look in the database.<br>
Saving them as 1000 individual values makes 1000 records in the<br>
database, saving them as 1 large record makes 1 record. These are<br>
treated differently on update and display.<br>
<br>
If you follow the advice of the wiki article that was linked to and<br>
reach around the API, you'll hurt yourself.<br>
<br>
Not recording transactions is orthogonal to the size of the data which<br>
can be recorded.<br></blockquote><div><br></div><div style>I'm sorry - I'm pretty sure I'm reading you correctly but I'm unable to add multiple values to a Custom Field without creating multiple ObjectCustomFieldValue records. Maybe it's not possible to do so.</div>
<div style><br></div><div style>The %Updates hash is a hash of arrays like this (this is one key, I don't know why Dumper prints it as two VARs):<br></div><div style><div style><div><font face="courier new, monospace">$VAR11 = 'Customer';</font></div>
<div><font face="courier new, monospace">$VAR12 = [</font></div><div style><font face="courier new, monospace"> '1xxx59',</font></div><div style><font face="courier new, monospace"> '1xxx22',</font></div>
<div style><font face="courier new, monospace"> '1xxx56',</font></div><div style><font face="courier new, monospace"> '1xxx5',</font></div><div style><font face="courier new, monospace"> '6xxx5',</font></div>
<div style><font face="courier new, monospace"> '1xxx93',</font></div><div style><font face="courier new, monospace"> '6xxx1',</font></div><div style><font face="courier new, monospace"> '4xxx1',</font></div>
<div style><font face="courier new, monospace"> '2xxx1',</font></div><div style><font face="courier new, monospace"> '3xxx8',</font></div><div style><font face="courier new, monospace"> '6xxx7',</font></div>
<div style><font face="courier new, monospace"> '1xxx08',</font></div><div style><font face="courier new, monospace"> '1xxx36'</font></div><div><font face="courier new, monospace"> ];</font></div>
<div><br></div><div>Here's what I've tried and seen:<br></div></div><div><font face="courier new, monospace">foreach my $ufn (keys %Updates) {<br></font></div><div><font face="courier new, monospace"> $ticket->AddCustomFieldValue( Field => $ufn, Value => join("\n", @{$Updates{$ufn}}), RecordTransaction => 0 );</font></div>
<div><font face="courier new, monospace">}</font></div></div></div><div>-- What this does is adds one ObjectCustomFieldValue record with \n between some stuff. These are displayed in RT as values with spaces between them.<br>
</div><div style><div class="gmail_quote"><div><br></div><div><font face="courier new, monospace">foreach my $ufn (keys %Updates) {<br></font></div><div><font face="courier new, monospace"> $ticket->AddCustomFieldValue( Field => $ufn, Value => join(',', @{$Updates{$ufn}}), RecordTransaction => 0 );</font></div>
<div><font face="courier new, monospace">}</font></div><div style>-- I didn't think this would really work but I thought I'd try it anyway. Same thing but comma delimited. They are displayed in RT as values with commas between them.</div>
</div></div><div style><br></div><div style>So in other words I'm starting to think I've been after something that can't be done. RecordTransaction => 0 stops the "Transactions" table from getting a ton of records added to it (one for each OCFV record added) but I cannot avoid tons of OCFV records being added.</div>
<div style><br></div>-- <br><div dir="ltr"><div><span style="font-family:arial;font-size:small">Landon Stewart :: </span><a href="mailto:lstewart@iweb.com" style="font-family:arial;font-size:small" target="_blank">lstewart@iweb.com</a><br>
</div><span style="font-family:arial;font-size:small">Lead Specialist, Abuse and Security Management</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:small">Spécialiste principal, gestion des abus et sécurité</span><br style="font-family:arial;font-size:small">
<span style="font-family:arial;font-size:small"><a href="http://iweb.com" target="_blank">http://iweb.com</a> :: +1 (888) 909-4932</span><br><div><span style="font-family:arial;font-size:small"><br></span></div><div><span style="font-family:arial;font-size:small"><br>
</span></div></div>
</div></div>