Hi,
I have an AttributeExternalKey in Incidents and UserRequest and want to prefill its searchform.
I have added this method:
<methodid="PrefillSearchForm"_delta="define"><static>false</static><access>public</access><type>Overload-DBObject</type><arguments><argumentid="1"><type>reference</type><mandatory>true</mandatory></argument></arguments><code><![CDATA[ public function PrefillSearchForm(&$aContextParam) { if($aContextParam['dest_class'] == 'FunctionalCI' && $aContextParam['origin'] == 'console') { $aContextParam['filter']->ResetCondition(); $aContextParam['filter']->AddCondition('finalclass', 'ApplicationSolution', 'IN'); } } ]]></code></method>
I can see that prefill works when I try adding a CI via the Tab(Functional CIs) but it's not working on the AttributeExternalKey which also points to the class "FunctionalCI".
What am I missing?
Thanks,
best regards, Nico
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
An AttributeExternalKey cannot be prefilled with PrefillSearchForm, but there is a simpler mean, just use the XML tag "filter" on the AttributeExternalKey to define an OQL filter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
thanks for the reply. I already tested it and I think this will be my solution.
The only bad thing in this solution is that you have to select an other class via the drop-down field, if another selection should be made, because the filter tag disabled the field in the filter tab bar.
Anyway, I will try this :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you be more specific on what you want to achieve?
Check again the wiki, in general the Searched Class and the class containing the method are different...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Vincent.
First, thank you very much for the help.
You see, what I'm trying to do is behave similar to what occurs when we assign a user to an organization and from then on, only he sees the data associated with that organization. But instead of filtering by organization, I want to filter by certain states.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have an AttributeExternalKey in Incidents and UserRequest and want to prefill its searchform.
I have added this method:
I can see that prefill works when I try adding a CI via the Tab(Functional CIs) but it's not working on the AttributeExternalKey which also points to the class "FunctionalCI".
What am I missing?
Thanks,
best regards, Nico
An AttributeExternalKey cannot be prefilled with PrefillSearchForm, but there is a simpler mean, just use the XML tag "filter" on the AttributeExternalKey to define an OQL filter
Hi,
thanks for the reply. I already tested it and I think this will be my solution.
The only bad thing in this solution is that you have to select an other class via the drop-down field, if another selection should be made, because the filter tag disabled the field in the filter tab bar.
Anyway, I will try this :-)
Hola.
I am trying to replicate this and it has no effect. I don't know if I have defined the method in a wrong place.
Thank you.
Ana
Can you be more specific on what you want to achieve?
Check again the wiki, in general the Searched Class and the class containing the method are different...
Hi Vincent.
First, thank you very much for the help.
You see, what I'm trying to do is behave similar to what occurs when we assign a user to an organization and from then on, only he sees the data associated with that organization. But instead of filtering by organization, I want to filter by certain states.
Hu Ana,
In your code the value "No visible" for 'status' is probably not a valid enum code, it expects the code-value not its label