[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rt-devel
Subject:    [rt-devel] Create a CustomField and Apply it Globally
From:       Red Pantyhose <redpantyhose () yahoo ! com>
Date:       2012-10-24 11:51:11
Message-ID: 1351079471.40754.YahooMailNeo () web163404 ! mail ! gq1 ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Dear RT-Developpers

I have a problem applying a CustomField in a Scrip I created.

I like to create dynamically create CustomFields and Apply them Globally.

The RT::CustomField->Cerate() Code below works ...

But I have to ApplyGlobally manually via : 

$WebURL/rt/Admin/CustomFields/Objects.html

because I'm unable to understand how to deal with 

RT::CustomField->ApplyGlobally

Can you send me an Example how to deal with ApplyGlobally ?

Thanks sincerely,


# --- MY CODE ---#

my $cf = RT::CustomField->new( RT::SystemUser );

my ( $cf_val, $cf_msg ) = $cf->Create(
            Name          => 'NAME_FROM_DB',
            TypeComposite => 'Freeform-1',
            LookupType    => 'RT::Queue-RT::Ticket',
            Description   => 'DESCRIPTION_RETRIVED_FROM_DB',
            Pattern       => '',
            LinkValueTo   => '',
            IncludeContentForValue => '',
            BasedOn       => '',
            Disabled      => 0,
);

# Please help me here ????
$cf = RT::CustomField->new( RT::SystemUser );
$cf->Load( Id => $cf_val );
$cf->ApplyGlobally;
[Attachment #5 (text/html)]

<html><body><div style="color:#000; background-color:#fff; font-family:arial, \
helvetica, sans-serif;font-size:12pt">Dear RT-Developpers<br><br>I have a problem \
applying a CustomField in a Scrip I created.<br><br>I like to create dynamically \
create CustomFields and Apply them Globally.<br><br>The RT::CustomField-&gt;Cerate() \
Code below works ...<br><br>But I have to ApplyGlobally manually via : \
<br><br>$WebURL/rt/Admin/CustomFields/Objects.html<br><br>because I'm unable to \
understand how to deal with <br><br>RT::CustomField-&gt;ApplyGlobally<br><br>Can you \
send me an Example how to deal with ApplyGlobally ?<br><br>Thanks \
sincerely,<br><br><br># --- MY CODE ---#<br><br>my $cf = RT::CustomField-&gt;new( \
RT::SystemUser );<br><br>my ( $cf_val, $cf_msg ) = \
$cf-&gt;Create(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt;  \
'NAME_FROM_DB',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
TypeComposite =&gt; 'Freeform-1',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
LookupType&nbsp;&nbsp;&nbsp; =&gt; \
'RT::Queue-RT::Ticket',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Description&nbsp;&nbsp; =&gt; \
'DESCRIPTION_RETRIVED_FROM_DB',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Pattern&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; \
'',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
LinkValueTo&nbsp;&nbsp; =&gt; \
'',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
IncludeContentForValue =&gt; \
'',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
BasedOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; \
'',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Disabled&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt;  0,<br>);<br><br># Please help me here \
????<br>$cf = RT::CustomField-&gt;new( RT::SystemUser );<br>$cf-&gt;Load( Id =&gt; \
$cf_val );<br>$cf-&gt;ApplyGlobally;<br><br></div></body></html>



--------
Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic