Callbacks - Hiding custom fields

Hi,

I’ve added a new item to the RT ticket menu bar along with the relevant
page when you click the link so
the menu bar looks as follows:

Display History Basics Outcome People …

This all works fine, the new Outcome page is based on the Modify.html
in which there is a callback

Now let callbacks have a chance at editing %ARGS

$m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields,
ARGSRef => %ARGS );

I have written a boiler plate callback which is being called, however
my question is how do I massage the
customfields in the callback to hide some of them from the user?

I’m using RT 4.0.11 by the way.

Best Regards

Martin Wheldon
Greenhills IT Ltd.
Telephone: 01904 238 454

Greenhills IT Ltd. is a limited company registered in England and
Wales.
Company Registration No: 06387214
Registered Offices: 2 Greenhills, Claxton, YORK, North Yorkshire, YO60
7SA

Hi,

I can iterate over the customfields with the following code:

while ( my $customfield = $CustomFields->Next()) {
RT::Logger->info("CF = " . $customfield->Name . " " .
$customfield->Disabled);
}

And get the information about the customfield find, I can even set the
a customfield to disabled
however I’m unsure on how to mask a CF from the page?

Googling throws up the following extension:

But looking at the documentation Limit no longer exists.

Is it as simple as removing the customfield from the $CustomFields
object?

Best Regards

MartinOn 2013-05-01 19:39, Martin Wheldon wrote:

Hi,

I’ve added a new item to the RT ticket menu bar along with the
relevant page when you click the link so
the menu bar looks as follows:

Display History Basics Outcome People …

This all works fine, the new Outcome page is based on the Modify.html
in which there is a callback

Now let callbacks have a chance at editing %ARGS

$m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields,
ARGSRef => %ARGS );

I have written a boiler plate callback which is being called, however
my question is how do I massage the
customfields in the callback to hide some of them from the user?

I’m using RT 4.0.11 by the way.

Best Regards

And get the information about the customfield find, I can even set the a customfield to disabled
however I’m unsure on how to mask a CF from the page?

Googling throws up the following extension:
rt-extension-customfield-hideemptyvalues/MassageCustomFields at master · bestpractical/rt-extension-customfield-hideemptyvalues · GitHub

But looking at the documentation Limit no longer exists.

Is it as simple as removing the customfield from the $CustomFields object?

What documentation says that Limit doesn’t exist? The Limit method is a
fundamental part of DBIx::SearchBuilder and RT.

$CustomFields->Limit(
FIELD => ‘Name’,
OPERATOR => ‘!=’,
VALUE => ‘Foo’,
);

There’s no API to “remove” an object from a DBIx::SearchBuilder
collection; you should instead limit your search so it isn’t found.

Hi Thomas,

Sorry my bad, I was looking in the
RT 4.0.25 Documentation - Best Practical I hadn’t realised that it was
part
of DBIx::SearchBuilder.

I’ve got it working nicely now thanks very much

Best Regards

MartinOn 2013-05-02 21:40, Thomas Sibley wrote:

On 05/02/2013 02:47 AM, Martin Wheldon wrote:

And get the information about the customfield find, I can even set
the a customfield to disabled
however I’m unsure on how to mask a CF from the page?

Googling throws up the following extension:

rt-extension-customfield-hideemptyvalues/MassageCustomFields at master · bestpractical/rt-extension-customfield-hideemptyvalues · GitHub

But looking at the documentation Limit no longer exists.

Is it as simple as removing the customfield from the $CustomFields
object?

What documentation says that Limit doesn’t exist? The Limit method
is a
fundamental part of DBIx::SearchBuilder and RT.

$CustomFields->Limit(
FIELD => ‘Name’,
OPERATOR => ‘!=’,
VALUE => ‘Foo’,
);

There’s no API to “remove” an object from a DBIx::SearchBuilder
collection; you should instead limit your search so it isn’t found.

!DSPAM:9,5182cfee33235294820404!