More of a Perl question I think...

English! place to talk about development, programming and coding
Post Reply
seberget2
Znuny newbie
Posts: 74
Joined: 17 May 2013, 09:30
Znuny Version: 6.0.30
Real Name: Stein Erik Berget

More of a Perl question I think...

Post by seberget2 »

Trying to make a module that uses dynamic fields. And I need to be able to search for this configurable dynamic field name. I see the following in the OTRS dev documentation

Code: Select all

my @TicketIDs = $TicketObject->TicketSearch(
        DynamicField_FieldNameX => {
            Equals            => 123,
}
How do I set the FieldNameX from

Code: Select all

 $Self->{ConfigObject}->Get('MyModule::MyDynamicFieldName')
Hope you can help me out.
OTRS 6.0.12 on Ubuntu with MySQL DB, and various plug-ins and a hack or two :-D
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: More of a Perl question I think...

Post by reneeb »

Code: Select all

my $Name = $Self->{ConfigObject}->Get('MyModule::MyDynamicFieldName') || '';
my @TicketIDs = $TicketObject->TicketSearch(
        "DynamicField_$Name" => {
            Equals            => 123,
       }
);
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
seberget2
Znuny newbie
Posts: 74
Joined: 17 May 2013, 09:30
Znuny Version: 6.0.30
Real Name: Stein Erik Berget

Re: More of a Perl question I think...

Post by seberget2 »

Thank you so much!
OTRS 6.0.12 on Ubuntu with MySQL DB, and various plug-ins and a hack or two :-D
Post Reply